Changeset 21787


Ignore:
Timestamp:
Nov 3, 2011, 5:46:14 PM (14 years ago)
Author:
dmik
Message:

Workaround stdcall bug in GCC related to vararg functions.

This can be easily removed once GCC gets fixed.

Location:
branches/gcc-kmk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/gcc-kmk/include/_ras.h

    r21755 r21787  
    4949
    5050/* Tracked objects logging functions typedefs */
    51 typedef void WIN32API FNRASLOG_EXTERNAL (const char *fmt, ...);
     51typedef void WIN32API_VA FNRASLOG_EXTERNAL (const char *fmt, ...);
    5252
    5353typedef ULONG WIN32API FNLOC (ULONG objident, ULONG objhandle, void *objdata, ULONG cbobjdata, FNRASLOG_EXTERNAL *pRasLog);
     
    150150
    151151/* RAS logging functions */
    152 void WIN32API RasLog (
     152void WIN32API_VA RasLog (
    153153                  const char *fmt,                 /* 'printf' style format string */
    154154                  ...
    155155              );
    156156
    157 void WIN32API RasLogNoEOL (
     157void WIN32API_VA RasLogNoEOL (
    158158                  const char *fmt,                 /* 'printf' style format string */
    159159                  ...
     
    173173              );
    174174
    175 void WIN32API RasLog2 (
     175void WIN32API_VA RasLog2 (
    176176                  RAS_LOG_CHANNEL_H hchannel,      /* log channel to log to */
    177177                  char *fmt,                       /* 'printf' style format string */
     
    179179              );
    180180
    181 void WIN32API RasLogNoEOL2 (
     181void WIN32API_VA RasLogNoEOL2 (
    182182                  RAS_LOG_CHANNEL_H hchannel,      /* log channel to log to */
    183183                  char *fmt,                       /* 'printf' style format string */
     
    194194/* RAS replacement for C runtime sprintf function */
    195195#ifdef __GNUC__
    196 int WIN32API ras_snprintf (
     196int WIN32API_VA ras_snprintf (
    197197#else
    198198int WIN32API snprintf (
     
    266266    void  (* WIN32API RasWriteLogChannel) (RAS_LOG_CHANNEL_H hchannel, const char *msg, ULONG length);
    267267    void  (* WIN32API RasCloseLogChannel) (RAS_LOG_CHANNEL_H hchannel);
    268     void  (* WIN32API RasLog) (RAS_LOG_CHANNEL_H hchannel, char *fmt, ...);
    269     void  (* WIN32API RasLogNoEOL) (RAS_LOG_CHANNEL_H hchannel, char *fmt, ...);
     268    void  (* WIN32API_VA RasLog) (RAS_LOG_CHANNEL_H hchannel, char *fmt, ...);
     269    void  (* WIN32API_VA RasLogNoEOL) (RAS_LOG_CHANNEL_H hchannel, char *fmt, ...);
    270270    void  (* WIN32API RasLogMsg) (RAS_LOG_CHANNEL_H hchannel, ULONG msg, ULONG parm1, ULONG parm2);
    271     int   (* WIN32API snprintf) (char *buf, int n, const char *fmt, ...);
     271    int   (* WIN32API_VA snprintf) (char *buf, int n, const char *fmt, ...);
    272272    void  (* WIN32API RasSaveContext) (RASCONTEXT *pcontext);
    273273    void  (* WIN32API RasRestoreContext) (RASCONTEXT *pcontext);
  • branches/gcc-kmk/include/odin.h

    r21738 r21787  
    171171#endif
    172172
    173 
     173#ifdef __GNUC__
     174// __stdcall in GCC for OS/2 incorrectly mangles vararg functions; according to
     175// MSDN, they should be equal to __cdecl instead of getting the @N suffix
     176#define WIN32API_VA __cdecl
     177#else
     178#define WIN32API_VA WIN32API
     179#endif
    174180
    175181#endif /* _ODIN_H_*/
  • branches/gcc-kmk/src/kernel32/_ras.cpp

    r21755 r21787  
    618618
    619619#ifdef __GNUC__
    620 int WIN32API ras_snprintf (char *buf, int n, const char *fmt, ...)
     620int WIN32API_VA ras_snprintf (char *buf, int n, const char *fmt, ...)
    621621#else
    622622int WIN32API snprintf (char *buf, int n, const char *fmt, ...)
     
    853853}
    854854
    855 void WIN32API rasLogExternal (const char *fmt, ...)
     855void WIN32API_VA rasLogExternal (const char *fmt, ...)
    856856{
    857857    va_list args;
     
    18641864
    18651865
    1866 void WIN32API RasLog (const char *fmt, ...)
     1866void WIN32API_VA RasLog (const char *fmt, ...)
    18671867{
    18681868    ENTER_RAS (NO_HANDLE);
     
    18791879}
    18801880
    1881 void WIN32API RasLogNoEOL (const char *fmt, ...)
     1881void WIN32API_VA RasLogNoEOL (const char *fmt, ...)
    18821882{
    18831883    va_list args;
     
    20082008}
    20092009
    2010 void WIN32API RasLog2 (RAS_LOG_CHANNEL_H hchannel, char *fmt, ...)
     2010void WIN32API_VA RasLog2 (RAS_LOG_CHANNEL_H hchannel, char *fmt, ...)
    20112011{
    20122012    ENTER_RAS (NO_HANDLE);
     
    20232023}
    20242024
    2025 void WIN32API RasLogNoEOL2 (RAS_LOG_CHANNEL_H hchannel, char *fmt, ...)
     2025void WIN32API_VA RasLogNoEOL2 (RAS_LOG_CHANNEL_H hchannel, char *fmt, ...)
    20262026{
    20272027    va_list args;
Note: See TracChangeset for help on using the changeset viewer.