src/stdafx.h
branchgamebalance
changeset 9895 7bd07f43b0e3
parent 6520 c35345c0897d
child 9908 0fa543611bbe
equal deleted inserted replaced
9894:70d78ac95d6c 9895:7bd07f43b0e3
     6 /* It seems that we need to include stdint.h before anything else
     6 /* It seems that we need to include stdint.h before anything else
     7  * We need INT64_MAX, which for most systems comes from stdint.h. However, MSVC
     7  * We need INT64_MAX, which for most systems comes from stdint.h. However, MSVC
     8  * does not have stdint.h and apparently neither does MorphOS, so define
     8  * does not have stdint.h and apparently neither does MorphOS, so define
     9  * INT64_MAX for them ourselves. */
     9  * INT64_MAX for them ourselves. */
    10 #if !defined(_MSC_VER) && !defined( __MORPHOS__)
    10 #if !defined(_MSC_VER) && !defined( __MORPHOS__)
    11 # define __STDC_LIMIT_MACROS
    11 # if defined (SUNOS)
    12 # include <stdint.h>
    12 /* SunOS/Solaris does not have stdint.h, but inttypes.h defines everything
       
    13  * stdint.h defines and we need. */
       
    14 #  include <inttypes.h>
       
    15 # else
       
    16 #  define __STDC_LIMIT_MACROS
       
    17 #  include <stdint.h>
       
    18 # endif
    13 #else
    19 #else
    14 # define INT64_MAX 9223372036854775807LL
    20 # define INT64_MAX 9223372036854775807LL
    15 #endif
    21 #endif
    16 
    22 
    17 #include <cstdio>
    23 #include <cstdio>
   190 
   196 
   191 /* NOTE: the string returned by these functions is only valid until the next
   197 /* NOTE: the string returned by these functions is only valid until the next
   192  * call to the same function and is not thread- or reentrancy-safe */
   198  * call to the same function and is not thread- or reentrancy-safe */
   193 #if !defined(STRGEN)
   199 #if !defined(STRGEN)
   194 # if defined(WIN32) || defined(WIN64)
   200 # if defined(WIN32) || defined(WIN64)
   195 #  if defined(WINCE)
   201 #  include <tchar.h>
   196 /* XXX - WinCE without MSVCRT doesn't support wfopen, so it seems */
   202 /* XXX - WinCE without MSVCRT doesn't support wfopen, so it seems */
   197 #  else
   203 #  if !defined(WINCE)
   198 #   define fopen(file, mode) _wfopen(OTTD2FS(file), L ## mode)
   204 #   define fopen(file, mode) _tfopen(OTTD2FS(file), _T(mode))
   199 #  endif
   205 #  endif /* WINCE */
   200    const char *FS2OTTD(const wchar_t *name);
   206 
   201    const wchar_t *OTTD2FS(const char *name);
   207    const char *FS2OTTD(const TCHAR *name);
       
   208    const TCHAR *OTTD2FS(const char *name);
   202 # else
   209 # else
       
   210 
   203 #  define fopen(file, mode) fopen(OTTD2FS(file), mode)
   211 #  define fopen(file, mode) fopen(OTTD2FS(file), mode)
   204    const char *FS2OTTD(const char *name);
   212    const char *FS2OTTD(const char *name);
   205    const char *OTTD2FS(const char *name);
   213    const char *OTTD2FS(const char *name);
   206 # endif /* WIN32 */
   214 # endif /* WIN32 */
   207 #endif /* STRGEN */
   215 #endif /* STRGEN */