aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Elliott <ian@lunarg.com>2015-02-26 14:34:52 -0700
committerCourtney Goeltzenleuchter <courtney@LunarG.com>2015-03-02 17:21:11 -0700
commit4aaa3ed005530a2b1600d1981fcc39a6297d94b3 (patch)
tree22ea313eada1f17d2aa52993455b14f2e2d83ca6
parent06f82818902ab66bb63c0fb4569cea76b10f2c03 (diff)
downloadusermoji-4aaa3ed005530a2b1600d1981fcc39a6297d94b3.tar.xz
Linux: Must use "__linux__" instead of "PLATFORM_LINUX".
There are some places (e.g. glave) where PLATFORM_LINUX is #define'd, but normally we need to rely on "__linux__", which is #define'd by the compiler (i.e. we can rely on it being there).
-rw-r--r--include/xglLayer.h4
-rwxr-xr-xxgl-generate.py10
-rwxr-xr-xxgl-layer-generate.py10
3 files changed, 12 insertions, 12 deletions
diff --git a/include/xglLayer.h b/include/xglLayer.h
index 6a81c90f..d6a7fbb2 100644
--- a/include/xglLayer.h
+++ b/include/xglLayer.h
@@ -6,7 +6,7 @@
#include "xgl.h"
#include "xglDbg.h"
-#if defined(PLATFORM_LINUX) || defined(XCB_NVIDIA)
+#if defined(__linux__) || defined(XCB_NVIDIA)
#include "xglWsiX11Ext.h"
#endif
#if defined(__GNUC__) && __GNUC__ >= 4
@@ -149,7 +149,7 @@ typedef struct _XGL_LAYER_DISPATCH_TABLE
xglDbgSetDeviceOptionType DbgSetDeviceOption;
xglCmdDbgMarkerBeginType CmdDbgMarkerBegin;
xglCmdDbgMarkerEndType CmdDbgMarkerEnd;
-#if defined(PLATFORM_LINUX) || defined(XCB_NVIDIA)
+#if defined(__linux__) || defined(XCB_NVIDIA)
xglWsiX11AssociateConnectionType WsiX11AssociateConnection;
xglWsiX11GetMSCType WsiX11GetMSC;
xglWsiX11CreatePresentableImageType WsiX11CreatePresentableImage;
diff --git a/xgl-generate.py b/xgl-generate.py
index f4dd5485..44ba04c2 100755
--- a/xgl-generate.py
+++ b/xgl-generate.py
@@ -121,7 +121,7 @@ class LoaderEntrypointsSubcommand(Subcommand):
if not self._is_dispatchable(proto):
continue
if 'WsiX11AssociateConnection' == proto.name:
- funcs.append("#if defined(PLATFORM_LINUX) || defined(XCB_NVIDIA)")
+ funcs.append("#if defined(__linux__) || defined(XCB_NVIDIA)")
decl = proto.c_func(prefix="xgl", attr="XGLAPI")
stmt = "(*disp)->%s" % proto.c_call()
if proto.name == "CreateDevice":
@@ -265,7 +265,7 @@ class DispatchTableOpsSubcommand(Subcommand):
stmts = []
for proto in self.protos:
if 'WsiX11AssociateConnection' == proto.name:
- stmts.append("#if defined(PLATFORM_LINUX) || defined(XCB_NVIDIA)")
+ stmts.append("#if defined(__linux__) || defined(XCB_NVIDIA)")
if proto.name == "GetProcAddr":
stmts.append("table->%s = gpa; /* direct assignment */" %
proto.name)
@@ -291,7 +291,7 @@ class DispatchTableOpsSubcommand(Subcommand):
lookups = []
for proto in self.protos:
if 'WsiX11AssociateConnection' == proto.name:
- lookups.append("#if defined(PLATFORM_LINUX) || defined(XCB_NVIDIA)")
+ lookups.append("#if defined(__linux__) || defined(XCB_NVIDIA)")
lookups.append("if (!strcmp(name, \"%s\"))" % (proto.name))
lookups.append(" return (void *) table->%s;"
% (proto.name))
@@ -367,7 +367,7 @@ class IcdGetProcAddrSubcommand(IcdDummyEntrypointsSubcommand):
lookups = []
for proto in self.protos:
if 'WsiX11AssociateConnection' == proto.name:
- lookups.append("#if defined(PLATFORM_LINUX) || defined(XCB_NVIDIA)")
+ lookups.append("#if defined(__linux__) || defined(XCB_NVIDIA)")
lookups.append("if (!strcmp(%s, \"%s\"))" %
(gpa_pname, proto.name))
lookups.append(" return (%s) %s%s;" %
@@ -412,7 +412,7 @@ class LayerInterceptProcSubcommand(Subcommand):
continue
if 'WsiX11AssociateConnection' == proto.name:
- lookups.append("#if defined(PLATFORM_LINUX) || defined(XCB_NVIDIA)")
+ lookups.append("#if defined(__linux__) || defined(XCB_NVIDIA)")
lookups.append("if (!strcmp(name, \"%s\"))" % proto.name)
lookups.append(" return (%s) %s%s;" %
(self.gpa.ret, self.prefix, proto.name))
diff --git a/xgl-layer-generate.py b/xgl-layer-generate.py
index aa3832dd..6cb2bef2 100755
--- a/xgl-layer-generate.py
+++ b/xgl-layer-generate.py
@@ -196,7 +196,7 @@ class Subcommand(object):
ret_val = "XGL_RESULT result = "
stmt = " return result;\n"
if 'WsiX11AssociateConnection' == proto.name:
- funcs.append("#if defined(PLATFORM_LINUX) || defined(XCB_NVIDIA)")
+ funcs.append("#if defined(__linux__) || defined(XCB_NVIDIA)")
if proto.name == "EnumerateLayers":
c_call = proto.c_call().replace("(" + proto.params[0].name, "((XGL_PHYSICAL_GPU)gpuw->nextObject", 1)
funcs.append('%s%s\n'
@@ -370,7 +370,7 @@ class Subcommand(object):
#log_func += '\n fflush(stdout);'
log_func += '\n }'
if 'WsiX11AssociateConnection' == proto.name:
- funcs.append("#if defined(PLATFORM_LINUX) || defined(XCB_NVIDIA)")
+ funcs.append("#if defined(__linux__) || defined(XCB_NVIDIA)")
if proto.name == "EnumerateLayers":
c_call = proto.c_call().replace("(" + proto.params[0].name, "((XGL_PHYSICAL_GPU)gpuw->nextObject", 1)
funcs.append('%s%s\n'
@@ -519,7 +519,7 @@ class Subcommand(object):
log_func += '\n fflush(stdout);'
log_func += '\n free(pTmpStr);\n }'
if 'WsiX11AssociateConnection' == proto.name:
- funcs.append("#if defined(PLATFORM_LINUX) || defined(XCB_NVIDIA)")
+ funcs.append("#if defined(__linux__) || defined(XCB_NVIDIA)")
if proto.name == "EnumerateLayers":
c_call = proto.c_call().replace("(" + proto.params[0].name, "((XGL_PHYSICAL_GPU)gpuw->nextObject", 1)
funcs.append('%s%s\n'
@@ -658,7 +658,7 @@ class Subcommand(object):
ret_val = "XGL_RESULT result = "
stmt = " return result;\n"
if 'WsiX11AssociateConnection' == proto.name:
- funcs.append("#if defined(PLATFORM_LINUX) || defined(XCB_NVIDIA)")
+ funcs.append("#if defined(__linux__) || defined(XCB_NVIDIA)")
if proto.name == "EnumerateLayers":
c_call = proto.c_call().replace("(" + proto.params[0].name, "((XGL_PHYSICAL_GPU)gpuw->nextObject", 1)
funcs.append('%s%s\n'
@@ -767,7 +767,7 @@ class Subcommand(object):
ret_val = "XGL_RESULT result = "
stmt = " return result;\n"
if 'WsiX11AssociateConnection' == proto.name:
- funcs.append("#if defined(PLATFORM_LINUX) || defined(XCB_NVIDIA)")
+ funcs.append("#if defined(__linux__) || defined(XCB_NVIDIA)")
if proto.name == "EnumerateLayers":
c_call = proto.c_call().replace("(" + proto.params[0].name, "((XGL_PHYSICAL_GPU)gpuw->nextObject", 1)
funcs.append('%s%s\n'