From 34b9de9a246cefc99b1f60783134995b6a96c631 Mon Sep 17 00:00:00 2001 From: Rodrigo Silva Date: Fri, 25 Mar 2016 15:19:12 -0300 Subject: [PATCH] use a GCC equivalent for __stdcall where applicable GCC on 32-bit architectures has __attribute__((stdcall)) as an equivalent to Windows __stdcall, so use it conditionally instead of leaving it blank for all non-Windows platforms. This may benefit all platforms where GCC or compatible compilers are used, including (but not limited to) Linux. --- include/ext_ADL.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/ext_ADL.h b/include/ext_ADL.h index 0146b8b2a..71ec07f71 100644 --- a/include/ext_ADL.h +++ b/include/ext_ADL.h @@ -250,9 +250,18 @@ typedef struct ADLOD6PowerControlInfo int iExtMask; } ADLOD6PowerControlInfo; +/* __stdcall definition, platform-dependent: + * - Already defined on Windows compilers + * - GCC has a suitable equivalent on 32-bit platforms + * - Leave it blank for other platforms/compilers + */ #if !(defined (_WIN32) || defined (_WIN64)) +#if (defined(__GNUC__) && defined(__i386__)) +#define __stdcall __attribute__((stdcall)) +#else #define __stdcall -#endif +#endif /* GCC 32-bit */ +#endif /* Not windows */ typedef void* (__stdcall *ADL_MAIN_MALLOC_CALLBACK )( int );