home *** CD-ROM | disk | FTP | other *** search
- #ifndef __DEF__
- #define __DEF__
-
- // You can define three choice
- // CLEXP, CLIMP, CLNULL
-
- #ifdef CLEXP
- #define CLPREF __declspec(dllexport)
- #elif CLIMP
- #define CLPREF __declspec(dllimport)
- #else // CLNULL
- #define CLPREF
- #endif
-
- #ifndef EXTERN_C
- #define EXTERN_C extern "C"
- #endif //EXTERN_C
-
- //--------------------------------
- #ifndef WIN32
- #ifndef FNLOCAL
- #define FNLOCAL NEAR PASCAL
- #define FNCLOCAL NEAR _cdecl
- #define FNGLOBAL FAR PASCAL
- #define FNCGLOBAL FAR _cdecl
-
- #ifdef _WINDLL
- #define FNWCALLBACK FAR PASCAL __loadds
- #define FNEXPORT FAR PASCAL __export
- #else
- #define FNWCALLBACK FAR PASCAL
- #define FNEXPORT FAR PASCAL __export
- #endif
- #endif
-
- #ifndef FIELD_OFFSET
- #define FIELD_OFFSET(type, field) ((LONG)&(((type *)0)->field))
- #endif
-
- #define BCODE _based(_segname("_CODE"))
-
- #define HUGE _huge
- //
- // stuff for Unicode in Win 32--make it a noop in Win 16
- //
- #ifndef _TCHAR_DEFINED
- #define _TCHAR_DEFINED
- typedef char TCHAR, *PTCHAR;
- typedef unsigned char TBYTE, *PTUCHAR;
-
- typedef PSTR PTSTR, PTCH;
- typedef LPSTR LPTSTR, LPTCH;
- typedef LPCSTR LPCTSTR;
- #endif
-
- #define TEXT(a) a
- #define SIZEOF(x) sizeof(x)
- #define SIZEOFACMSTR(x) sizeof(x)
- #else
- #ifndef FNLOCAL
- #define FNLOCAL _stdcall
- #define FNCLOCAL _stdcall
- #define FNGLOBAL _stdcall
- #define FNCGLOBAL _stdcall
- #define FNWCALLBACK CALLBACK
- #define FNEXPORT CALLBACK
- #endif
-
- #ifndef _CRTAPI1
- #define _CRTAPI1 __cdecl
- #endif
-
- #ifndef _CRTAPI2
- #define _CRTAPI2 __cdecl
- #endif
-
- /* #ifndef try
- #define try __try
- #define leave __leave
- #define except __except
- #define finally __finally
- #endif
- */
- #define BCODE
- #define HUGE
- #define HTASK HANDLE
- #define SELECTOROF(a) (a)
-
- // typedef LRESULT (CALLBACK* DRIVERPROC)(DWORD, HDRVR, UINT, LPARAM, LPARAM);
-
- //
- // for compiling Unicode
- //
- #ifdef UNICODE
- #define SIZEOF(x) (sizeof(x)/sizeof(WCHAR))
- #else
- #define SIZEOF(x) sizeof(x)
- #endif
- #define SIZEOFACMSTR(x) (sizeof(x)/sizeof(WCHAR))
- #endif // WIN32
-
- #endif
-