#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_*/

