mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-15 09:20:52 +08:00
9697f95b8f
This reverts commit 15d999759e
.
99 lines
2.6 KiB
C++
99 lines
2.6 KiB
C++
#pragma once
|
|
|
|
#ifdef ACL_CPP_LIB
|
|
# ifndef ACL_CPP_API
|
|
# define ACL_CPP_API
|
|
# endif
|
|
#elif defined(ACL_CPP_DLL) || defined(_WINDLL)
|
|
# if defined(ACL_CPP_EXPORTS) || defined(acl_cpp_EXPORTS)
|
|
# ifndef ACL_CPP_API
|
|
# define ACL_CPP_API __declspec(dllexport)
|
|
# endif
|
|
# elif !defined(ACL_CPP_API)
|
|
# define ACL_CPP_API __declspec(dllimport)
|
|
# endif
|
|
#elif !defined(ACL_CPP_API)
|
|
# define ACL_CPP_API
|
|
#endif
|
|
|
|
/*
|
|
#ifndef ACL_CPP_TPL
|
|
# ifdef ACL_CPP_DLL
|
|
# ifdef ACL_CPP_EXPORTS
|
|
# define ACL_CPP_TPL __declspec(dllexport)
|
|
# else
|
|
# define ACL_CPP_TPL
|
|
# endif
|
|
# else
|
|
# define ACL_CPP_TPL
|
|
# endif
|
|
#endif
|
|
*/
|
|
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <errno.h>
|
|
#include <string.h>
|
|
|
|
#ifdef _MSC_VER
|
|
# pragma warning(disable:4251)
|
|
//# if !defined(VC2003) && !defined(VC6)
|
|
//extern "C" { FILE _iob[3] = {__iob_func()[0], __iob_func()[1], __iob_func()[2]}; }
|
|
//extern "C" { FILE _iob[3]; }
|
|
//# endif
|
|
# ifndef HAS_SSIZE_T
|
|
# define HAS_SSIZE_T
|
|
typedef long ssize_t;
|
|
# endif
|
|
# if(_MSC_VER >= 1300)
|
|
# include <winsock2.h>
|
|
# include <mswsock.h>
|
|
# else
|
|
# include <winsock.h>
|
|
# endif
|
|
#else
|
|
# ifdef HAVE_MEMCACHED
|
|
# undef HAVE_MEMCACHED
|
|
# endif
|
|
#endif
|
|
|
|
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
|
|
#define ACL_CPP_PRINTF(format_idx, arg_idx) \
|
|
__attribute__((__format__ (__printf__, (format_idx), (arg_idx))))
|
|
#define ACL_CPP_SCANF(format_idx, arg_idx) \
|
|
__attribute__((__format__ (__scanf__, (format_idx), (arg_idx))))
|
|
#define ACL_CPP_NORETURN __attribute__((__noreturn__))
|
|
#define ACL_CPP_UNUSED __attribute__((__unused__))
|
|
#else
|
|
#define ACL_CPP_PRINTF(format_idx, arg_idx)
|
|
#define ACL_CPP_SCANF
|
|
#define ACL_CPP_NORETURN
|
|
#define ACL_CPP_UNUSED
|
|
#endif // __GNUC__
|
|
|
|
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
|
|
#define ACL_CPP_DEPRECATED __attribute__((__deprecated__))
|
|
#elif defined(_MSC_VER) && (_MSC_VER >= 1300)
|
|
#define ACL_CPP_DEPRECATED __declspec(deprecated)
|
|
#else
|
|
#define ACL_CPP_DEPRECATED
|
|
#endif // __GNUC__
|
|
|
|
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
|
|
#define ACL_CPP_DEPRECATED_FOR(f) __attribute__((deprecated("Use " #f " instead")))
|
|
#elif defined(_MSC_FULL_VER) && (_MSC_FULL_VER > 140050320)
|
|
#define ACL_CPP_DEPRECATED_FOR(f) __declspec(deprecated("is deprecated. Use '" #f "' instead"))
|
|
#else
|
|
#define ACL_CPP_DEPRECATED_FOR(f) ACL_CPP_DEPRECATED
|
|
#endif // __GNUC__
|
|
|
|
#if defined(__GNUC__) && (__GNUC__ > 6 ||(__GNUC__ == 6 && __GNUC_MINOR__ >= 0))
|
|
# ifndef ACL_USE_CPP11
|
|
# define ACL_USE_CPP11
|
|
# endif
|
|
#elif defined(_MSC_VER) && (_MSC_VER >= 1900)
|
|
# ifndef ACL_USE_CPP11
|
|
# define ACL_USE_CPP11
|
|
# endif
|
|
#endif // __GNUC__
|