2019-07-28 10:31:56 +08:00
|
|
|
#pragma once
|
2014-11-19 00:25:21 +08:00
|
|
|
|
2017-03-31 23:04:16 +08:00
|
|
|
#ifdef ACL_CPP_LIB
|
|
|
|
# ifndef ACL_CPP_API
|
|
|
|
# define ACL_CPP_API
|
|
|
|
# endif
|
2020-11-05 16:05:47 +08:00
|
|
|
#elif defined(ACL_CPP_DLL) // || defined(_WINDLL)
|
2017-03-31 23:04:16 +08:00
|
|
|
# if defined(ACL_CPP_EXPORTS) || defined(acl_cpp_EXPORTS)
|
|
|
|
# ifndef ACL_CPP_API
|
2014-11-19 00:25:21 +08:00
|
|
|
# define ACL_CPP_API __declspec(dllexport)
|
|
|
|
# endif
|
2017-03-31 23:04:16 +08:00
|
|
|
# elif !defined(ACL_CPP_API)
|
|
|
|
# define ACL_CPP_API __declspec(dllimport)
|
2014-11-19 00:25:21 +08:00
|
|
|
# endif
|
2017-03-31 23:04:16 +08:00
|
|
|
#elif !defined(ACL_CPP_API)
|
|
|
|
# define ACL_CPP_API
|
2014-11-19 00:25:21 +08:00
|
|
|
#endif
|
2015-02-07 22:55:24 +08:00
|
|
|
|
2017-03-31 23:04:16 +08:00
|
|
|
/*
|
2015-02-07 22:55:24 +08:00
|
|
|
#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
|
2017-03-31 23:04:16 +08:00
|
|
|
*/
|
2015-02-07 22:55:24 +08:00
|
|
|
|
2014-11-19 00:25:21 +08:00
|
|
|
#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
|
2015-04-04 15:25:29 +08:00
|
|
|
# ifndef HAS_SSIZE_T
|
2020-09-22 21:17:58 +08:00
|
|
|
# define HAS_SSIZE_T
|
2020-09-22 21:39:41 +08:00
|
|
|
# if defined(_WIN64)
|
2020-09-22 21:17:58 +08:00
|
|
|
typedef __int64 ssize_t;
|
2020-09-22 21:39:41 +08:00
|
|
|
# elif defined(_WIN32)
|
|
|
|
typedef int ssize_t;
|
2020-09-22 21:17:58 +08:00
|
|
|
# else
|
2015-04-04 15:25:29 +08:00
|
|
|
typedef long ssize_t;
|
2020-09-22 21:17:58 +08:00
|
|
|
# endif
|
2014-11-19 00:25:21 +08:00
|
|
|
# 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__
|
2016-10-08 22:11:25 +08:00
|
|
|
|
|
|
|
#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__
|
2020-06-12 15:14:26 +08:00
|
|
|
|
2020-06-13 10:55:25 +08:00
|
|
|
//#define ACL_CPP_DEBUG_MEM
|