summaryrefslogtreecommitdiffstats
path: root/include/D3D9
diff options
context:
space:
mode:
authorChristian Schmidbauer <[email protected]>2016-03-13 22:50:31 +0100
committerAxel Davy <[email protected]>2016-04-02 23:30:40 +0200
commit2a529a8ac810b3b40e7a9a071d9544b168928b94 (patch)
treeb4641b45c83d9bd8651ae6eb85e6c6a388ddde27 /include/D3D9
parent0852c5703b57cb277b893e7e9db48c47712a0846 (diff)
st/nine: specify WINAPI only for i386 and amd64
Currently mesa fails building with the x32 abi as ms_abi is not defined in such a case. The patch uses ms_abi only for amd64 targets and stdcall only for i386 targets to be sure that those are defined. This patch additionally checks for __GNUC__ to guarantee that __attribute__ is available. CC: "11.1 11.2" <[email protected]> Signed-off-by: Christian Schmidbauer <[email protected]> Acked-by: Axel Davy <[email protected]>
Diffstat (limited to 'include/D3D9')
-rw-r--r--include/D3D9/d3d9types.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/include/D3D9/d3d9types.h b/include/D3D9/d3d9types.h
index d74ce80bb30..e0b86523daa 100644
--- a/include/D3D9/d3d9types.h
+++ b/include/D3D9/d3d9types.h
@@ -178,11 +178,17 @@ typedef struct _RGNDATA {
#undef WINAPI
#endif /* WINAPI*/
-#if defined(__x86_64__) || defined(_M_X64)
-#define WINAPI __attribute__((ms_abi))
-#else /* x86_64 */
-#define WINAPI __attribute__((__stdcall__))
-#endif /* x86_64 */
+#ifdef __GNUC__
+ #if (defined(__x86_64__) && !defined(__ILP32__)) || defined(_M_X64)
+ #define WINAPI __attribute__((ms_abi))
+ #elif defined(__i386) || defined(_M_IX86)
+ #define WINAPI __attribute__((__stdcall__))
+ #else /* neither amd64 nor i386 */
+ #define WINAPI
+ #endif
+#else /* __GNUC__ */
+ #define WINAPI
+#endif
/* Implementation caps */
#define D3DPRESENT_BACK_BUFFERS_MAX 3