-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathHelperMacros.h
52 lines (43 loc) · 1.42 KB
/
HelperMacros.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef UNITTEST_HELPERMACROS_H
#define UNITTEST_HELPERMACROS_H
#include "Config.h"
#define UNITTEST_MULTILINE_MACRO_BEGIN do {
#if defined(UNITTEST_WIN32) && !defined(UNITTEST_COMPILER_IS_MSVC6)
#define UNITTEST_MULTILINE_MACRO_END \
} __pragma(warning(push)) __pragma(warning(disable:4127)) while (0) __pragma(warning(pop))
#else
#define UNITTEST_MULTILINE_MACRO_END } while(0)
#endif
#ifdef UNITTEST_WIN32_DLL
#define UNITTEST_IMPORT __declspec(dllimport)
#define UNITTEST_EXPORT __declspec(dllexport)
#ifdef UNITTEST_DLL_EXPORT
#define UNITTEST_LINKAGE UNITTEST_EXPORT
#define UNITTEST_IMPEXP_TEMPLATE
#else
#define UNITTEST_LINKAGE UNITTEST_IMPORT
#define UNITTEST_IMPEXP_TEMPLATE extern
#endif
#define UNITTEST_STDVECTOR_LINKAGE(T) \
__pragma(warning(push)) \
__pragma(warning(disable:4231)) \
UNITTEST_IMPEXP_TEMPLATE template class UNITTEST_LINKAGE std::allocator< T >; \
UNITTEST_IMPEXP_TEMPLATE template class UNITTEST_LINKAGE std::vector< T >; \
__pragma(warning(pop))
#else
#define UNITTEST_IMPORT
#define UNITTEST_EXPORT
#define UNITTEST_LINKAGE
#define UNITTEST_IMPEXP_TEMPLATE
#define UNITTEST_STDVECTOR_LINKAGE(T)
#endif
#ifdef UNITTEST_WIN32
#define UNITTEST_JMPBUF jmp_buf
#define UNITTEST_SETJMP setjmp
#define UNITTEST_LONGJMP longjmp
#elif defined UNITTEST_POSIX
#define UNITTEST_JMPBUF std::jmp_buf
#define UNITTEST_SETJMP setjmp
#define UNITTEST_LONGJMP std::longjmp
#endif
#endif