Changeset 21941


Ignore:
Timestamp:
Jan 18, 2012, 11:30:59 AM (13 years ago)
Author:
dmik
Message:

Add DEF_VAL macro to define argument's default values.

This is necessary to use functions with default values in C code.

Location:
trunk/include
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/include/odin.h

    r21916 r21941  
    172172#endif
    173173
     174#ifdef __cplusplus
     175#define DEF_VAL(v) = v
     176#else
     177#define DEF_VAL(v)
     178#endif
     179
    174180#ifdef __GNUC__
    175181// __stdcall in GCC for OS/2 incorrectly mangles vararg functions; according to
  • TabularUnified trunk/include/odinlx.h

    r21916 r21941  
    2929typedef int (* WIN32API WINMAIN)(HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpCmdLine, int nShowCmd);
    3030
    31 #ifdef __cplusplus
    32 
    3331//******************************************************************************
    3432//Create LX Dll object and send process attach message
     
    4745DWORD WIN32API RegisterLxDll(HINSTANCE hInstance, WIN32DLLENTRY EntryPoint,
    4846                             PVOID pResData,
    49                              DWORD MajorImageVersion = ODINNT_MAJOR_VERSION,
    50                              DWORD MinorImageVersion = ODINNT_MINOR_VERSION,
    51                              DWORD Subsystem = IMAGE_SUBSYSTEM_WINDOWS_CUI);
    52 #else
    53 
    54 DWORD WIN32API RegisterLxDll(HINSTANCE hInstance, WIN32DLLENTRY EntryPoint,
    55                              PVOID pResData,
    56                              DWORD MajorImageVersion,
    57                              DWORD MinorImageVersion,
    58                              DWORD Subsystem) ;
    59 
    60 #endif
     47                             DWORD MajorImageVersion DEF_VAL(ODINNT_MAJOR_VERSION),
     48                             DWORD MinorImageVersion DEF_VAL(ODINNT_MINOR_VERSION),
     49                             DWORD Subsystem DEF_VAL(IMAGE_SUBSYSTEM_WINDOWS_CUI));
    6150
    6251//******************************************************************************
  • TabularUnified trunk/include/wprocess.h

    r21916 r21941  
    4040// Set up the TEB structure of the CURRENT (!) thread
    4141//******************************************************************************
    42 BOOL   WIN32API InitializeThread(TEB *teb, BOOL fMainThread = FALSE);
     42BOOL   WIN32API InitializeThread(TEB *teb, BOOL fMainThread DEF_VAL(FALSE));
    4343
    4444void   WIN32API DestroyTEB(TEB *teb);
     
    5151//NOTE: This is not done for Odin32 applications (LX), unless
    5252//      fForceSwitch is TRUE)
    53 USHORT WIN32API SetWin32TIB(BOOL fForceSwitch = TIB_SWITCH_DEFAULT);
     53USHORT WIN32API SetWin32TIB(BOOL fForceSwitch DEF_VAL(TIB_SWITCH_DEFAULT));
    5454void   WIN32API RestoreOS2TIB();
    5555
Note: See TracChangeset for help on using the changeset viewer.