41 lines
843 B
C
41 lines
843 B
C
|
#pragma once
|
||
|
|
||
|
// 导出宏定义
|
||
|
#if defined(_WIN32)
|
||
|
#if defined(XNCORE_LIBRARY)
|
||
|
#define XNCORE_EXPORT __declspec(dllexport)
|
||
|
#else
|
||
|
#define XNCORE_EXPORT __declspec(dllimport)
|
||
|
#endif
|
||
|
#elif defined(__linux__)
|
||
|
#if defined(XNCORE_LIBRARY)
|
||
|
#define XNCORE_EXPORT __attribute__((visibility("default")))
|
||
|
#else
|
||
|
#define XNCORE_EXPORT __attribute__((visibility("default")))
|
||
|
#endif
|
||
|
#endif
|
||
|
|
||
|
// 内联宏定义
|
||
|
#if defined(_WIN32)
|
||
|
#define FORCEINLINE __forceinline
|
||
|
#else
|
||
|
#define FORCEINLINE __attribute__((always_inline))
|
||
|
#endif
|
||
|
|
||
|
// 平台相关头文件
|
||
|
#if defined(_WIN32)
|
||
|
#include <windows.h>
|
||
|
#include <winsock2.h>
|
||
|
#include <ws2tcpip.h>
|
||
|
#elif defined(__linux__)
|
||
|
#include <dlfcn.h>
|
||
|
#include <errno.h>
|
||
|
#include <limits.h>
|
||
|
#include <pthread.h>
|
||
|
#include <sched.h>
|
||
|
#include <sys/mman.h>
|
||
|
#include <sys/stat.h>
|
||
|
#include <sys/timeb.h>
|
||
|
#include <unistd.h>
|
||
|
#endif
|