Ignore:
Timestamp:
Apr 9, 2008, 10:22:08 PM (17 years ago)
Author:
cinc
Message:

Portability patches for Windows, Linux, Darwin by Bird.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/nom/include/nom.h

    r281 r326  
    4343  #define NOMEXTERN extern "C"
    4444 #else
    45    #define NOMEXTERN extern
     45  #define NOMEXTERN extern
    4646 #endif
    4747#endif
     
    6565#define NOMDLINK
    6666
     67/** @def NOMDLLEXPORT
     68 * Used for exporting a symbol.
     69 * See __declspec(dllexport) in the Visual C++ reference for details. */
     70/** @def NOMDLLIMPORT
     71 * Used for importing a symbol from a DLL/so.
     72 * See __declspec(dllimport) in the Visual C++ reference for details. */
     73#if defined(_WIN32) || (defined(__OS2__) && defined(__GNUC__) && defined(__declspec))
     74# define NOMDLLEXPORT __declspec(dllexport)
     75# define NOMDLLIMPORT __declspec(dllimport)
     76#elif defined(__GNUC__)
     77# if __GNUC__ >= 4
     78#  define NOMDLLEXPORT __attribute__((visibility("default")))
     79# else
     80#  define NOMDLLEXPORT
     81# endif
     82# define NOMDLLIMPORT
     83#else
     84# define NOMDLLEXPORT
     85# define NOMDLLIMPORT
     86#endif
     87
    6788typedef void* NOMLINK nomMethodProc(void*);
    6889
    6990#ifndef NULL
    70 #define NULL ((void *) 0)
     91# ifdef __cplusplus
     92#  define NULL 0
     93# else
     94#  define NULL ((void *) 0)
     95# endif
    7196#endif
    7297
Note: See TracChangeset for help on using the changeset viewer.