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