acl/lib_acl_cpp/include/acl_cpp/acl_cpp_define.hpp

63 lines
1.8 KiB
C++

#pragma once
#ifndef ACL_CPP_API
# ifdef ACL_CPP_DLL
# ifdef ACL_CPP_EXPORTS
# define ACL_CPP_API __declspec(dllexport)
# else
# define ACL_CPP_API __declspec(dllimport)
# endif
# else
# define ACL_CPP_API
# 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 ssize_t
# define ssize_t long
# 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__