src/stdafx.h
branchgamebalance
changeset 9911 0b8b245a2391
parent 9909 dce9a6923bb7
child 9912 1ac8aac92385
equal deleted inserted replaced
9910:0b2aebc8283e 9911:0b8b245a2391
    76 #  undef AMIGA
    76 #  undef AMIGA
    77 # endif
    77 # endif
    78 # ifdef amiga
    78 # ifdef amiga
    79 #  undef amiga
    79 #  undef amiga
    80 # endif
    80 # endif
       
    81 /* Act like we already included this file, as it somehow gives linkage problems
       
    82  *  (mismatch linkage of C++ and C between this include and unistd.h). */
       
    83 #define CLIB_USERGROUP_PROTOS_H
    81 #endif /* __MORPHOS__ */
    84 #endif /* __MORPHOS__ */
    82 
    85 
    83 #ifdef __APPLE__
    86 #ifdef __APPLE__
    84 # include "os/macosx/osx_stdafx.h"
    87 # include "os/macosx/osx_stdafx.h"
    85 /* Make endian swapping use Apple's macros to increase speed (since it will use hardware swapping if available)
    88 /* Make endian swapping use Apple's macros to increase speed (since it will use hardware swapping if available)
   107 #if defined(__GNUC__)
   110 #if defined(__GNUC__)
   108 # define NORETURN __attribute__ ((noreturn))
   111 # define NORETURN __attribute__ ((noreturn))
   109 # define FORCEINLINE inline
   112 # define FORCEINLINE inline
   110 # define CDECL
   113 # define CDECL
   111 # define __int64 long long
   114 # define __int64 long long
   112 # define NOT_REACHED() assert(0)
       
   113 # define GCC_PACK __attribute__((packed))
   115 # define GCC_PACK __attribute__((packed))
   114 
   116 
   115 # if (__GNUC__ == 2)
   117 # if (__GNUC__ == 2)
   116 #  undef VARARRAY_SIZE
   118 #  undef VARARRAY_SIZE
   117 #  define VARARRAY_SIZE 0
   119 #  define VARARRAY_SIZE 0
   120 
   122 
   121 #if defined(__WATCOMC__)
   123 #if defined(__WATCOMC__)
   122 # define NORETURN
   124 # define NORETURN
   123 # define FORCEINLINE inline
   125 # define FORCEINLINE inline
   124 # define CDECL
   126 # define CDECL
   125 # define NOT_REACHED() assert(0)
       
   126 # define GCC_PACK
   127 # define GCC_PACK
   127 # include <malloc.h>
   128 # include <malloc.h>
   128 #endif /* __WATCOMC__ */
   129 #endif /* __WATCOMC__ */
   129 
   130 
   130 #if defined(__MINGW32__) || defined(__CYGWIN__)
   131 #if defined(__MINGW32__) || defined(__CYGWIN__)
   158 # include <malloc.h> // alloca()
   159 # include <malloc.h> // alloca()
   159 # define NORETURN __declspec(noreturn)
   160 # define NORETURN __declspec(noreturn)
   160 # define FORCEINLINE __forceinline
   161 # define FORCEINLINE __forceinline
   161 # define inline _inline
   162 # define inline _inline
   162 # define CDECL _cdecl
   163 # define CDECL _cdecl
   163 # if defined(_DEBUG)
       
   164 #  define NOT_REACHED() assert(0)
       
   165 # else
       
   166 #  define NOT_REACHED() _assume(0)
       
   167 # endif /* _DEBUG */
       
   168   int CDECL snprintf(char *str, size_t size, const char *format, ...);
   164   int CDECL snprintf(char *str, size_t size, const char *format, ...);
   169 # if _MSC_VER < 1400
   165 # if _MSC_VER < 1400
   170    int CDECL vsnprintf(char *str, size_t size, const char *format, va_list ap);
   166    int CDECL vsnprintf(char *str, size_t size, const char *format, va_list ap);
   171 # endif
   167 # endif
   172 
   168 
   329 #ifdef __AMIGA__
   325 #ifdef __AMIGA__
   330 /* it seems AmigaOS already have a Point declared */
   326 /* it seems AmigaOS already have a Point declared */
   331 # define Point OTTD_AMIGA_POINT
   327 # define Point OTTD_AMIGA_POINT
   332 #endif
   328 #endif
   333 
   329 
       
   330 void
       
   331 #ifndef STRGEN
       
   332 /* In strgen error is not fatal and returns */
       
   333 NORETURN
       
   334 #endif /* STRGEN */
       
   335 CDECL error(const char *str, ...);
       
   336 #define NOT_REACHED() error("NOT_REACHED triggered at line %i of %s", __LINE__, __FILE__)
       
   337 
   334 #endif /* STDAFX_H */
   338 #endif /* STDAFX_H */