Changeset 13


Ignore:
Timestamp:
18.09.2011 13:26:19 (7 years ago)
Author:
stefan.ruppert@…
Message:

#8 fixed calling convention problem under linux/x86 32-bit due to wrong usage of pre-defined pre-processor defines

Location:
arm4sdk/trunk/c/include
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • arm4sdk/trunk/c/include/arm4.h

    r4 r13  
    2222/*                                                                           */ 
    2323/* ------------------------------------------------------------------------- */ 
    24 /*                                                                           */ 
    25 /* File revision information                                                 */ 
    26 /*                                                                           */ 
    27 /* $Source: /tang_cvs/arm4/sdk4/c/include/arm4.h,v $    */ 
    28 /* $Revision: 1.2 $  */ 
    29 /* $Date: 2003/12/03 13:55:14 $      */ 
    30 /*                                                                           */ 
    31 /* --------------------------------------------------------------- */ 
    3224/* arm4.h - ARM4 standard header file                              */ 
    3325/*                                                                 */ 
  • arm4sdk/trunk/c/include/arm4os.h

    r5 r13  
    2020/* OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR  */ 
    2121/* THE USE OR OTHER DEALINGS IN THE SOFTWARE.                                */ 
    22 /*                                                                           */ 
    23 /* ------------------------------------------------------------------------- */ 
    24 /*                                                                           */ 
    25 /* File revision information                                                 */ 
    26 /*                                                                           */ 
    27 /* $Source: /tang_cvs/arm4/sdk4/c/include/arm4os.h,v $    */ 
    28 /* $Revision: 1.4 $  */ 
    29 /* $Date: 2004/03/04 09:24:49 $      */ 
    3022/*                                                                           */ 
    3123/* ------------------------------------------------------------------------- */ 
     
    8476#endif 
    8577 
     78#if defined(linux) || defined(__linux__) || defined(__linux) 
     79#if !defined(__linux__) 
     80#define __linux__ 
     81#endif 
     82#endif 
     83 
    8684/* ------------------------------------------------------------------------- */ 
    8785/* ------------- Step 1: determine 32 and 64 bit integer types ------------- */ 
     
    242240#endif /* _WIN32 || _WIN64 */ 
    243241 
    244 #if defined(linux) 
     242#if defined(__linux__) 
    245243 
    246244#if defined(__GNUC__) 
  • arm4sdk/trunk/c/include/arm4sdk.h

    r1 r13  
    5454/*                                                                           */ 
    5555/* ------------------------------------------------------------------------- */ 
    56 /* Each OS platform needs to define the API calling convention for itself,   */ 
    57 /* and make sure the proper compiler keywords are used.                      */ 
    58 /*      ARM4SDK_API_CALL is for API calls with fixed # of parameters, while     */ 
    59  
    60 #if defined(_WIN32) || defined(_WIN64) 
    61 /* For 32-bit and 64-bit Windows, "stdcall" (pascal) calling convention is   */ 
    62 /* explicitly chosen for ARM4SDK_API_CALL to save a few instructions per call.  */ 
    63 #if defined(__GNUC__) 
    64 #define ARM4SDK_API_CALL    __attribute__((stdcall)) 
    65 #else 
    66 /* If a compiler does not support __stdcall or __cdecl, it will generate     */ 
    67 /* compile time errors when encountering these modifiers. Most compilers,    */ 
    68 /* e.g. _MSC_VER, __WATCOMC__, __BORLANDC__ and __MWERKS__ do support both.  */ 
    69 /* __INTEL_COMPILER knows both, too.                                         */ 
    70 #define ARM4SDK_API_CALL    __stdcall 
    71 #endif 
    72 #endif /* _WIN32 || _WIN64 */ 
    73  
    74 #if defined(linux) 
    75  
    76 #if defined(__GNUC__) 
    77  
    78 #if defined(__i386__) 
    79 #define ARM4SDK_API_CALL    __attribute__((stdcall)) 
    80 #endif 
    81  
    82 #elif !defined(__INTEL_COMPILER) 
    83 /* On linux the intel compiler doesn't support __stdcall !?!*/ 
    84 #define ARM4SDK_API_CALL    __stdcall 
    85  
    86 #endif 
    87 #endif /* linux ; END of ARM4SDK_API_CALL define section*/ 
    88  
    89 /* For other OS platforms, the compiler's default calling convention is used */ 
    90 /* and, hopefully, this won't cause link-time or run-time problems.          */ 
    91 #if !defined(ARM4SDK_API_CALL) 
    92 #define ARM4SDK_API_CALL 
    93 #endif 
     56 
     57 
     58/* We use the same calling convention as the standard ARM4 API calls */ 
     59#define ARM4SDK_API_CALL ARM4_API_CALL 
    9460 
    9561/* Set up the ARM4SDK_API_DYNAMIC definition here so the ARM library can be     */ 
Note: See TracChangeset for help on using the changeset viewer.