|
1 /************************************************************************ |
|
2 * |
|
3 * testdefs.h - common testsuite definitions |
|
4 * |
|
5 * $Id: testdefs.h 290599 2005-09-21 01:56:45Z sebor $ |
|
6 * |
|
7 *************************************************************************** |
|
8 * |
|
9 * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave |
|
10 * Software division. Licensed under the Apache License, Version 2.0 (the |
|
11 * "License"); you may not use this file except in compliance with the |
|
12 * License. You may obtain a copy of the License at |
|
13 * http://www.apache.org/licenses/LICENSE-2.0. Unless required by |
|
14 * applicable law or agreed to in writing, software distributed under |
|
15 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR |
|
16 * CONDITIONS OF ANY KIND, either express or implied. See the License |
|
17 * for the specific language governing permissions and limitations under |
|
18 * the License. |
|
19 * |
|
20 **************************************************************************/ |
|
21 |
|
22 #ifndef RW_TESTDEFS_H_INCLUDED |
|
23 #define RW_TESTDEFS_H_INCLUDED |
|
24 |
|
25 |
|
26 #include <rw/_defs.h> |
|
27 |
|
28 |
|
29 |
|
30 #if (defined (_WIN32) || defined (_WIN64)) \ |
|
31 && (defined (RWDLL) || defined (_RWSHARED)) |
|
32 # ifndef _RWSTD_TEST_SRC |
|
33 // using a shared lib, import names |
|
34 # define _TEST_EXPORT __declspec (dllimport) |
|
35 # else |
|
36 // building a shared (test) lib, export names |
|
37 # define _TEST_EXPORT __declspec (dllexport) |
|
38 # endif // _RWSTD_LIB_SRC |
|
39 #else |
|
40 # ifdef __SYMBIAN32__ |
|
41 #include <e32def.h> |
|
42 # ifdef STDCXX_TEST_ENGINE |
|
43 # define _TEST_EXPORT EXPORT_C |
|
44 # else |
|
45 # define _TEST_EXPORT IMPORT_C//__declspec(dllimport) |
|
46 # endif |
|
47 # else |
|
48 # define _TEST_EXPORT |
|
49 #endif |
|
50 #endif // archive/shared library |
|
51 |
|
52 |
|
53 #if defined (_RWSTD_NO_TYPENAME) && !defined (typename) |
|
54 # define typename /* ignore */ |
|
55 #endif // _RWSTD_NO_TYPENAME && !typename |
|
56 |
|
57 |
|
58 #ifndef _RWSTD_NO_FOR_INIT_SCOPE |
|
59 # if defined (__GNUG__) && __GNUG__ < 3 |
|
60 # define _RWSTD_NO_FOR_INIT_SCOPE |
|
61 # endif // gcc < 3.0 |
|
62 # if defined (_MSC_VER) && _MSC_VER < 1300 |
|
63 # define _RWSTD_NO_FOR_INIT_SCOPE |
|
64 # endif // MSVC < 7.0 |
|
65 #endif // _RWSTD_NO_FOR_INIT_SCOPE |
|
66 |
|
67 #ifdef _RWSTD_NO_FOR_INIT_SCOPE |
|
68 # define for if (0) ; else for |
|
69 #endif // _RWSTD_NO_FOR_INIT_SCOPE |
|
70 |
|
71 |
|
72 // _RWSTD_PRI{d,i,o,u,x}MAX: macros corresponding to those described |
|
73 // in 7.8.1 of C99; each of them expands to a character string literal |
|
74 // containing a conversion specifier, possibly modified by a length |
|
75 // modifier, suitable for use within the format argument of a formatted |
|
76 // input/output function when converting the corresponding integer type |
|
77 #if _RWSTD_LONG_SIZE < _RWSTD_LLONG_SIZE |
|
78 // using LLONG_SIZE instead of ULLONG_MAX in the preprocessor |
|
79 // conditional above to work around a gcc 3.2 bug (PR #28595) |
|
80 # define _RWSTD_PRIdMAX _RWSTD_LLONG_PRINTF_PREFIX "d" |
|
81 # define _RWSTD_PRIiMAX _RWSTD_LLONG_PRINTF_PREFIX "i" |
|
82 # define _RWSTD_PRIoMAX _RWSTD_LLONG_PRINTF_PREFIX "o" |
|
83 # define _RWSTD_PRIuMAX _RWSTD_LLONG_PRINTF_PREFIX "u" |
|
84 # define _RWSTD_PRIxMAX _RWSTD_LLONG_PRINTF_PREFIX "x" |
|
85 #elif _RWSTD_INT_SIZE < _RWSTD_LONG_SIZE |
|
86 # define _RWSTD_PRIdMAX "ld" |
|
87 # define _RWSTD_PRIiMAX "li" |
|
88 # define _RWSTD_PRIoMAX "lo" |
|
89 # define _RWSTD_PRIuMAX "lu" |
|
90 # define _RWSTD_PRIxMAX "lx" |
|
91 #else |
|
92 # define _RWSTD_PRIdMAX "d" |
|
93 # define _RWSTD_PRIiMAX "i" |
|
94 # define _RWSTD_PRIoMAX "o" |
|
95 # define _RWSTD_PRIuMAX "u" |
|
96 # define _RWSTD_PRIxMAX "x" |
|
97 #endif |
|
98 |
|
99 #ifndef __SYMBIAN32__ |
|
100 // _RWSTD_PRIz: expands to a conversion specifier corresponding |
|
101 // to "%z" (i.e., C99 size_t specifier) |
|
102 #if _RWSTD_SIZE_MAX == _RWSTD_UINT_MAX |
|
103 // sizeof (size_t) == sizeof (unsigned int) |
|
104 # define _RWSTD_PRIz "" |
|
105 #elif _RWSTD_SIZE_MAX == _RWSTD_ULONG_MAX |
|
106 // sizeof (size_t) == sizeof (unsigned long) |
|
107 # define _RWSTD_PRIz "l" |
|
108 #elif _RWSTD_SIZE_MAX == _RWSTD_ULLONG_MAX |
|
109 // sizeof (size_t) == sizeof (unsigned long long) |
|
110 # define _RWSTD_PRIz _RWSTD_LLONG_PRINTF_PREFIX "" |
|
111 #else |
|
112 // assume sizeof (size_t) == sizeof (unsigned) |
|
113 # define _RWSTD_PRIz "" |
|
114 #endif |
|
115 |
|
116 #endif |
|
117 |
|
118 #endif // RW_TESTDEFS_H_INCLUDED |