123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #ifndef _PLATFORM_H_
- #define _PLATFORM_H_
- #include <netinet/in.h>
- #include <sys/socket.h>
- #include <pthread.h>
- #include <fcntl.h>
- #include <errno.h>
- //#include <android/log.h>
- #include <arpa/inet.h>
- #include <unistd.h>
- #include <semaphore.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- #ifndef DELETE_POINTER
- #define DELETE_POINTER(p) \
- do\
- {\
- if (nullptr != p)\
- {\
- delete p;\
- p = nullptr;\
- }\
- } while (0)
- #endif
- #ifndef DELETE_POINTER_ARRAY
- #define DELETE_POINTER_ARRAY(p) \
- do\
- {\
- if (nullptr != p)\
- {\
- delete[] p;\
- p = nullptr;\
- }\
- } while (0)
- #endif
- #define sleep_ms(x) usleep(x * 1000)
- #define sleep_s(s) sleep(s)
- #define sleep_us(us) usleep(us)
- #define NetworkInit()
- #define NetworkCleanUp();
- #ifdef __cplusplus
- }
- #endif
- #endif/*#ifndef _PLATFORM_H_*/
|