2 /* Copyright (C) 2003 TSUTSUMI Kikuo.
3 This file is part of the CCUnit Library.
5 The CCUnit Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public License
7 as published by the Free Software Foundation; either version 2.1 of
8 the License, or (at your option) any later version.
10 The CCUnit Library is distributed in the hope that it will be
11 useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the CCUnit Library; see the file COPYING.LESSER.
17 If not, write to the Free Software Foundation, Inc., 59 Temple
18 Place - Suite 330, Boston, MA 02111-1307, USA.
26 * CCUnit configrations.
28 #ifndef CCUNITCONFIG_H
29 #define CCUNITCONFIG_H
31 #include <ccunit/config.h>
44 #elif defined (__cplusplus)
46 #define bool _Bool /**< boolean */
47 #define true ((bool)1) /**< true */
48 #define false ((bool)0) /**< false */
50 #define bool int /**< boolean */
51 #define true (1) /**< true */
52 #define false (0) /**< false */
56 typedef unsigned char u_char;
59 typedef unsigned int u_int;
62 typedef unsigned short u_short;
65 typedef unsigned long u_long;
68 typedef char* _ccunit_str_t;
69 typedef void* _ccunit_ptr_t;
71 #define _CCUNIT_CONCAT(A,B) A ## B
72 #define _CCUNIT_TOSTR(S) #S
76 * Omits dmalloc's free(NULL) warning.
77 * @param p [in/out] pointer to free. and set NULL.
79 #define safe_free(p) (!p ? NULL : (free (p), p = NULL))
82 * safty strdup. Tries not to pass NULL to strdup.
83 * @param s string to duplicate.
84 * @return duplicated string, or NULL when error occured.
86 #define safe_strdup(s) (!s ? NULL : strdup (s))