Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 1 | #ifndef COMMONCPP_CONFIG_H_ |
| 2 | #define COMMONCPP_CONFIG_H_ |
| 3 | |
| 4 | #ifndef _UCOMMON_UCOMMON_H_ |
| 5 | #include <ucommon/ucommon.h> |
| 6 | #endif |
| 7 | |
| 8 | #ifdef __EXPORT |
| 9 | #undef __EXPORT |
| 10 | #endif |
| 11 | |
| 12 | #define __EXPORT __SHARED |
| 13 | |
| 14 | // #include <streambuf> |
| 15 | #include <iostream> |
| 16 | |
| 17 | #define COMMONCPP_HEADERS |
| 18 | #define CCXX_NAMESPACES |
| 19 | #define COMMONCPP_NAMESPACE ost |
| 20 | #define NAMESPACE_COMMONCPP namespace ost { |
| 21 | #define TIMEOUT_INF ucommon::Timer::inf |
| 22 | |
| 23 | #ifdef _UCOMMON_EXTENDED_ |
| 24 | #define CCXX_EXCEPTIONS |
| 25 | #endif |
| 26 | |
| 27 | #ifdef AF_INET6 |
| 28 | #define CCXX_IPV6 |
| 29 | #endif |
| 30 | |
| 31 | #ifdef AF_INET |
| 32 | #define CCXX_IPV4 |
| 33 | #endif |
| 34 | |
| 35 | typedef pthread_t cctid_t; |
| 36 | typedef int8_t int8; |
| 37 | typedef uint8_t uint8; |
| 38 | typedef int16_t int16; |
| 39 | typedef uint16_t uint16; |
| 40 | typedef int32_t int32; |
| 41 | typedef uint32_t uint32; |
| 42 | typedef int64_t int64; |
| 43 | typedef uint64_t uint64; |
| 44 | |
| 45 | #if !defined(_MSWINDOWS_) && !defined(__QNX__) |
| 46 | |
| 47 | /** |
| 48 | * Convenience function for case insensitive null terminated string compare. |
| 49 | * @param string1 to compare. |
| 50 | * @param string2 to compare. |
| 51 | * @return 0 if equal, > 0 if s2 > s1, < 0 if s2 < s1. |
| 52 | */ |
| 53 | extern "C" inline int stricmp(const char *string1, const char *string2) |
| 54 | {return ucommon::String::case_compare(string1, string2);} |
| 55 | |
| 56 | /** |
| 57 | * Convenience function for case insensitive null terminated string compare. |
| 58 | * @param string1 to compare. |
| 59 | * @param string2 to compare. |
| 60 | * @param max size of string to compare. |
| 61 | * @return 0 if equal, > 0 if s2 > s1, < 0 if s2 < s1. |
| 62 | */ |
| 63 | extern "C" inline int strnicmp(const char *string1, const char *string2, size_t max) |
| 64 | {return ucommon::String::case_compare(string1, string2, max);} |
| 65 | |
| 66 | #endif |
| 67 | |
| 68 | |
| 69 | |
| 70 | #endif |