This commit is contained in:
Shengliang Guan 2022-02-28 19:22:49 +08:00
parent 400564b5a3
commit 4fe44df5b8
7 changed files with 19 additions and 19 deletions

View File

@ -13,8 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef TDENGINE_OS_H #ifndef _TD_OS_H_
#define TDENGINE_OS_H #define _TD_OS_H_
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -82,4 +82,4 @@ void osInit();
} }
#endif #endif
#endif #endif /*_TD_OS_H_*/

View File

@ -16,12 +16,12 @@
#ifndef _TD_OS_FILE_H_ #ifndef _TD_OS_FILE_H_
#define _TD_OS_FILE_H_ #define _TD_OS_FILE_H_
#include "osSocket.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include "osSocket.h"
#ifndef ALLOW_FORBID_FUNC #ifndef ALLOW_FORBID_FUNC
#define open OPEN_FUNC_TAOS_FORBID #define open OPEN_FUNC_TAOS_FORBID
#define fopen FOPEN_FUNC_TAOS_FORBID #define fopen FOPEN_FUNC_TAOS_FORBID

View File

@ -20,12 +20,12 @@
extern "C" { extern "C" {
#endif #endif
#define tfree(x) \ #define tfree(x) \
do { \ do { \
if (x) { \ if (x) { \
free((void *)(x)); \ free((void *)(x)); \
(x) = 0; \ (x) = 0; \
} \ } \
} while (0) } while (0)
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -16,12 +16,12 @@
#ifndef _TD_OS_SEMPHONE_H_ #ifndef _TD_OS_SEMPHONE_H_
#define _TD_OS_SEMPHONE_H_ #define _TD_OS_SEMPHONE_H_
#include <semaphore.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <semaphore.h>
#if defined (_TD_DARWIN_64) #if defined (_TD_DARWIN_64)
typedef struct tsem_s *tsem_t; typedef struct tsem_s *tsem_t;
int tsem_init(tsem_t *sem, int pshared, unsigned int value); int tsem_init(tsem_t *sem, int pshared, unsigned int value);

View File

@ -16,10 +16,6 @@
#ifndef _TD_OS_SOCKET_H_ #ifndef _TD_OS_SOCKET_H_
#define _TD_OS_SOCKET_H_ #define _TD_OS_SOCKET_H_
#ifdef __cplusplus
extern "C" {
#endif
#if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32) #if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32)
#include "winsock2.h" #include "winsock2.h"
#include <WS2tcpip.h> #include <WS2tcpip.h>
@ -30,6 +26,10 @@ extern "C" {
#include <sys/epoll.h> #include <sys/epoll.h>
#endif #endif
#ifdef __cplusplus
extern "C" {
#endif
#define TAOS_EPOLL_WAIT_TIME 500 #define TAOS_EPOLL_WAIT_TIME 500
typedef int32_t SOCKET; typedef int32_t SOCKET;
typedef SOCKET EpollFd; typedef SOCKET EpollFd;

View File

@ -16,12 +16,12 @@
#ifndef _TD_OS_SYSINFO_H_ #ifndef _TD_OS_SYSINFO_H_
#define _TD_OS_SYSINFO_H_ #define _TD_OS_SYSINFO_H_
#include "os.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include "os.h"
typedef struct { typedef struct {
int64_t total; int64_t total;
int64_t used; int64_t used;

View File

@ -16,12 +16,12 @@
#ifndef _TD_OS_THREAD_H_ #ifndef _TD_OS_THREAD_H_
#define _TD_OS_THREAD_H_ #define _TD_OS_THREAD_H_
#include <pthread.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <pthread.h>
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif