log_inner_include.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #ifndef LOG_INNER_INCLUDE_H
  2. #define LOG_INNER_INCLUDE_H
  3. //操作系统头文件
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include <string.h>
  7. #include <time.h>
  8. #include <stdarg.h>
  9. #include <errno.h>
  10. #ifdef WIN32
  11. #ifdef _DEBUG
  12. #define inline __inline
  13. #endif // !inline
  14. #include <winsock2.h>
  15. #include <sys/timeb.h>
  16. #include <windows.h>
  17. #include <process.h>
  18. #include <assert.h>
  19. typedef int socklen_t;
  20. #elif defined(_VXWORKS)
  21. #include <vxworks.h>
  22. #include <netdb.h>
  23. #include <string.h>
  24. #include <ctype.h>
  25. #include <types.h>
  26. #include <sockLib.h>
  27. #include <sys/types.h>
  28. #include <sys/socket.h>
  29. #include <sys/times.h>
  30. #include <netinet/tcp.h>
  31. #include <netinet/in.h>
  32. #include <netdb.h>
  33. #include <arpa/inet.h>
  34. #include <hostLib.h>
  35. #include <ticklib.h>
  36. #include <drv/timer/ppcDecTimer.h>
  37. #include <unistd.h>
  38. #include <signal.h>
  39. #include <pthread.h>
  40. #include <semaphore.h>
  41. #include <sys/ioctl.h>
  42. #include <net/if.h>
  43. #include <net/if_arp.h>
  44. #include <tipc/tipc.h>
  45. #include <taskLib.h>
  46. #include <selectLib.h>//for vx6
  47. #include <ioLib.h>
  48. #include <ioctl.h>
  49. #else
  50. #include <pthread.h>
  51. #include <unistd.h>
  52. #include <errno.h>
  53. #include <semaphore.h>
  54. #include <assert.h>
  55. #include <sys/time.h>
  56. #include <stdint.h>
  57. #endif
  58. #if defined WIN32 || defined _VXWORKS
  59. typedef unsigned char u_char;
  60. typedef unsigned char u_int8;
  61. typedef unsigned short u_int16;
  62. typedef unsigned int u_int32;
  63. typedef unsigned __int64 u_int64;
  64. typedef signed char int8;
  65. typedef signed short int16;
  66. typedef signed int int32;
  67. typedef signed __int64 int64;
  68. #elif defined __linux__
  69. typedef unsigned char u_char;
  70. typedef unsigned char u_int8;
  71. typedef unsigned short u_int16;
  72. typedef unsigned int u_int32;
  73. typedef unsigned long long u_int64;
  74. typedef signed char int8;
  75. typedef signed short int16;
  76. typedef signed int int32;
  77. typedef long long int64;
  78. typedef int SOCKET;
  79. #define SOCKET_ERROR -1
  80. #define INVALID_SOCKET -1
  81. #define __in // 参数输入
  82. #define __out // 参数输出
  83. #define closesocket close
  84. #define stricmp strcasecmp
  85. typedef int BOOL;
  86. #define TRUE 1
  87. #define FALSE 0
  88. #define Sleep(param) usleep(1000*(param))
  89. #define strcpy_s(a, b, c) strcpy(a, c)
  90. #define strncpy_s(a, b, c, d) strncpy(a, c, d)
  91. #define vsprintf_s(a, b, c, d) vsprintf(a, c, d)
  92. #define _strdup strdup
  93. #define _stricmp stricmp
  94. #endif
  95. #endif //LOG_INNER_INCLUDE_H