source: libcf++/trunk/include/cf/types.h@ 17

Last change on this file since 17 was 17, checked in by cheese, 9 years ago

#1 fix preprocessor for msvc14 (visual c++ 2015)

File size: 1.1 KB
Line 
1/**
2 * @file types.h
3 * @author myusgun@gmail.com
4 * @brief common header
5 */
6#ifndef __cf_types_h__
7#define __cf_types_h__
8
9#if defined(WIN32) || defined(_WIN32) || defined(_WIN64)
10# define _ON_WINDOWS
11# define __func__ __FUNCTION__
12# if _MSC_VER < 1900
13# define snprintf _snprintf
14# endif
15#endif
16
17namespace cf
18{
19 typedef void void_t;
20 typedef char char_t;
21 typedef unsigned char uchar_t;
22 typedef signed char int8_t;
23 typedef uchar_t uint8_t;
24 typedef signed short int16_t;
25 typedef unsigned short uint16_t;
26 typedef signed int int32_t;
27 typedef unsigned int uint32_t;
28 typedef long long_t;
29 typedef unsigned long ulong_t;
30 typedef bool bool_t;
31#ifdef _ON_WINDOWS
32 typedef signed __int64 int64_t;
33 typedef unsigned __int64 uint64_t;
34#else
35 typedef signed long long int64_t;
36 typedef unsigned long long uint64_t;
37#endif
38
39#ifdef _ON_WINDOWS
40 typedef uint32_t size_t;
41# ifdef _WIN64
42 typedef uint64_t socket_t;
43# else
44 typedef uint32_t socket_t;
45# endif
46#else
47 typedef ulong_t size_t;
48 typedef int32_t socket_t;
49#endif
50};
51
52#endif // #ifndef __cf_types_h__
Note: See TracBrowser for help on using the repository browser.