Changeset 7511


Ignore:
Timestamp:
06/28/18 19:40:56 (5 months ago)
Author:
baker
Message:

_OS2 is unsupported (#error), always #include standard C headers, remove _WINNT typedefs contained in stdint.h, add typedef's for ew_thread_t

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/platform.h

    r7508 r7511  
    1010#define PLATFORM_H 
    1111 
     12/***************************************************************** Standard C */ 
     13 
     14#include <stdint.h>                     /* C99 */ 
     15#include <stdio.h>                      /* C90 */ 
     16#include <stdlib.h>                     /* C90 */ 
     17 
    1218/********************************************************************* _WINNT */ 
    1319 
     
    1622#define WIN32_LEAN_AND_MEAN 
    1723#endif 
    18 #include <stdio.h> 
    19 #include <stdlib.h> 
    2024#include <winsock2.h>              /* Socket stuff */ 
    2125#include <windows.h> 
     
    2327#include <sys\types.h> 
    2428 
    25 /* For pre-MSVC 2010 define standard int types, otherwise use inttypes.h */ 
    26 #if defined(_MSC_VER) && _MSC_VER < 1600 
    27   typedef signed char int8_t; 
    28   typedef unsigned char uint8_t; 
    29   typedef signed short int int16_t; 
    30   typedef unsigned short int uint16_t; 
    31   typedef signed int int32_t; 
    32   typedef unsigned int uint32_t; 
    33   typedef signed __int64 int64_t; 
    34   typedef unsigned __int64 uint64_t; 
    35 #else 
    36   #include <inttypes.h> 
    37 #endif 
    38  
    39 #ifndef INT32_MAX 
    40   #define INT32_MAX 2147483647 
    41 #endif 
    42 #ifndef INT32_MIN 
    43   #define INT32_MIN (-2147483647 - 1) 
    44 #endif 
    45  
    46 /* Thread functions return this */ 
     29/* Thread functions return these */ 
    4730typedef void thr_ret; 
     31typedef uintptr_t ew_thread_t; 
    4832/* Value returned by thread functions; for Windows, nothing */ 
    4933#define THR_NULL_RET 
     
    6448 
    6549/* added so that logit.c can call vsnprintf for all platforms */ 
    66 # define vsnprintf _vsnprintf 
    67 # define  snprintf  _snprintf 
     50#define vsnprintf _vsnprintf 
     51#define  snprintf  _snprintf 
    6852 
    6953/* Thread priority constants.  These are based off the Win32 constants in winbase.h */ 
     
    8266 
    8367#ifdef _OS2 
    84 #define INCL_DOSPROCESS 
    85 #define INCL_DOSMEMMGR 
    86 #define INCL_DOSSEMAPHORES 
    87 #define INCL_DOSFILEMGR 
    88 #include <stdio.h> 
    89 #include <stdlib.h> 
    90 #include <malloc.h> 
    91 #include <os2.h> 
    92 #include <netinet\in.h>       /* contains typedef of struct sockaddr_in */ 
    93 #include <process.h>               /* Required for getpid() */ 
    94 #include <types.h> 
    95 #include <nerrno.h> 
    96 #include <sys\socket.h>            /* Socket stuff */ 
    97 #include <netdb.h>                 /* Socket stuff */ 
    98 /* Thread functions return this */ 
    99 typedef void thr_ret; 
    100 /* Value returned by thread functions; for OS2, nothing */ 
    101 #define THR_NULL_RET 
    102 typedef int  pid_t; 
    103 typedef HEV  sema_t; 
    104 typedef HMTX mutex_t; 
    105 typedef long timer_t; 
    106  
    107 typedef long DWORD; 
     68#error OS/2 is no longer a supported platform 
    10869#endif /* _OS2 */ 
    10970 
     
    11475/* broke this out on 2006/03/08 - paulf */ 
    11576/* note the LINUX/POSIX includes go here, mostly pthread changes */ 
    116 #include <stdio.h> 
    117 #include <stdlib.h> 
    11877#include <sys/types.h> 
    11978#include <netinet/in.h>            /* Socket stuff */ 
     
    13392#define fork1 fork 
    13493 
    135 /* Thread functions return this */ 
     94/* Thread functions return these */ 
    13695typedef void *thr_ret; 
     96typedef pthread_t ew_thread_t; 
    13797/* Value returned by thread functions; for UNIX, NULL */ 
    13898#define THR_NULL_RET (NULL) 
     
    168128#ifdef _MACOSX 
    169129#define _UNIX 
    170 #include <stdio.h> 
    171 #include <stdlib.h> 
    172130#include <sys/types.h> 
    173131#include <netinet/in.h>            /* Socket stuff */ 
     
    187145#define fork1 fork 
    188146 
    189 /* Thread functions return this */ 
     147/* Thread functions return these */ 
    190148typedef void *thr_ret; 
     149typedef pthread_t ew_thread_t; 
    191150/* Value returned by thread functions; for MACOSX, NULL */ 
    192151#define THR_NULL_RET (NULL) 
     
    221180#ifdef _SOLARIS 
    222181/* all SOLARIS includes now specifically go here */ 
    223 #include <stdio.h> 
    224 #include <stdlib.h> 
    225182#include <malloc.h> 
    226183#include <sys/types.h> 
     
    237194#include <netdb.h>                 /* Socket stuff */ 
    238195 
    239 /* Thread functions return this */ 
     196/* Thread functions return these */ 
    240197typedef void *thr_ret; 
     198typedef thread_t ew_thread_t; 
    241199/* Value returned by thread functions; for Solaris, NULL */ 
    242200#define THR_NULL_RET (NULL) 
Note: See TracChangeset for help on using the changeset viewer.