24 #ifndef _QORE_COMMON_H
26 #define _QORE_COMMON_H
46 #define Q_AF_UNSPEC -1
55 #define Q_SOCK_STREAM -1
77 #if defined _MSC_VER || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
79 #define DLLEXPORT __declspec(dllexport)
81 #define DLLEXPORT __declspec(dllimport)
87 #define QLLDx(a) "%" #a "I64d"
88 #define QORE_DIR_SEP '\\'
89 #define QORE_DIR_SEP_STR "\\"
91 #ifdef HAVE_GCC_VISIBILITY
92 #define DLLEXPORT __attribute__ ((visibility("default")))
93 #define DLLLOCAL __attribute__ ((visibility("hidden")))
100 #define QLLDx(a) "%" #a "lld"
101 #define QORE_DIR_SEP '/'
102 #define QORE_DIR_SEP_STR "/"
105 #define _Q_MAKE_STRING(x) #x
106 #define MAKE_STRING_FROM_SYMBOL(x) _Q_MAKE_STRING(x)
114 class QoreBuiltinMethod;
119 template <
typename T>
struct free_ptr : std::unary_function <T*, void> {
120 DLLLOCAL
void operator()(T *ptr) {
127 DLLLOCAL
void operator()(T *ptr) {
134 DLLLOCAL
void operator()(T *ptr) {
145 DLLLOCAL
bool operator()(
const char* s1,
const char* s2)
const {
146 return strcmp(s1, s2) < 0;
153 DLLLOCAL
bool operator()(
const char* s1,
const char* s2)
const {
154 return strcasecmp(s1, s2) < 0;
161 DLLLOCAL
bool operator()(std::string s1, std::string s2)
const {
162 return strcasecmp(s1.c_str(), s2.c_str()) < 0;
168 DLLLOCAL
bool operator()(
const char* s1,
const char* s2)
const {
169 return !strcmp(s1, s2);
175 DLLLOCAL
bool operator()(
const char* s1,
const char* s2)
const {
176 return !strcasecmp(s1, s2);
183 DLLLOCAL
bool operator()(
const char s1,
const char s2)
const {
205 typedef long long int64;
423 DLLEXPORT
long long q_atoll(
const char *str);
425 #endif // _QORE_COMMON_H