modified autogen.sh to remove reference to osl/
[converter.git] / include / converter / macros.h.in
blobe1f8b32f4f48fd4313756ef951817c08e421bae0
2 /*--------------------------------------------------------------------+
3 | Clay |
4 |--------------------------------------------------------------------|
5 | macros.h |
6 |--------------------------------------------------------------------|
7 | First version: 03/04/2012 |
8 +--------------------------------------------------------------------+
10 +--------------------------------------------------------------------------+
11 | / __)( ) /__\ ( \/ ) |
12 | ( (__ )(__ /(__)\ \ / Chunky Loop Alteration wizardrY |
13 | \___)(____)(__)(__)(__) |
14 +--------------------------------------------------------------------------+
15 | Copyright (C) 2012 University of Paris-Sud |
16 | |
17 | This library is free software; you can redistribute it and/or modify it |
18 | under the terms of the GNU Lesser General Public License as published by |
19 | the Free Software Foundation; either version 2.1 of the License, or |
20 | (at your option) any later version. |
21 | |
22 | This library is distributed in the hope that it will be useful but |
23 | WITHOUT ANY WARRANTY; without even the implied warranty of |
24 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser |
25 | General Public License for more details. |
26 | |
27 | You should have received a copy of the GNU Lesser General Public License |
28 | along with this software; if not, write to the Free Software Foundation, |
29 | Inc., 51 Franklin Street, Fifth Floor, |
30 | Boston, MA 02110-1301 USA |
31 | |
32 | Clay, the Chunky Loop Alteration wizardrY |
33 | Written by Cedric Bastoul, Cedric.Bastoul@u-psud.fr |
34 +--------------------------------------------------------------------------*/
36 /*--------------------------------------------------------------------------+
37 | THIS FILE HAS BEEN AUTOMATICALLY GENERATED FROM macros.h.in BY configure |
38 +--------------------------------------------------------------------------*/
40 #ifndef CLAY_MACROS_H
41 # define CLAY_MACROS_H
43 # define CLAY_VERSION "@PACKAGE_VERSION@"
45 # define CLAY_DEBUG 0
46 # define CLAY_TRUE 1
47 # define CLAY_FALSE 0
49 /*--------------------------------------------------------------------------+
50 | UTILITY MACROS |
51 +--------------------------------------------------------------------------*/
53 # define CLAY_info(msg) \
54 do { \
55 fprintf(stderr,"[Clay] Info: "msg" (%s).\n", __func__); \
56 } while (0)
58 # define CLAY_debug(msg) \
59 do { \
60 if (CLAY_DEBUG) \
61 fprintf(stderr,"[Clay] Debug: "msg" (%s).\n", __func__); \
62 } while (0)
64 # define CLAY_debug_call(function_call) \
65 do { \
66 if (CLAY_DEBUG) \
67 function_call; \
68 } while (0)
70 # define CLAY_warning(msg) \
71 do { \
72 fprintf(stderr,"[Clay] Warning: "msg" (%s).\n", __func__); \
73 } while (0)
75 # define CLAY_error(msg) \
76 do { \
77 fprintf(stderr,"[Clay] Error: "msg" (%s).\n", __func__); \
78 exit(1); \
79 } while (0)
81 # define CLAY_malloc(ptr, type, size) \
82 do { \
83 if (((ptr) = (type)malloc(size)) == NULL) \
84 CLAY_error("memory overflow"); \
85 } while (0)
87 # define CLAY_realloc(ptr, type, size) \
88 do { \
89 if (((ptr) = (type)realloc(ptr, size)) == NULL) \
90 CLAY_error("memory overflow"); \
91 } while (0)
93 # define CLAY_strdup(destination, source) \
94 do { \
95 if (source != NULL) { \
96 if (((destination) = strdup(source)) == NULL) \
97 CLAY_error("memory overflow"); \
98 } \
99 else { \
100 destination = NULL; \
101 CLAY_debug("strdup of a NULL string"); \
103 } while (0)
105 # define CLAY_max(x,y) ((x) > (y)? (x) : (y))
107 # define CLAY_min(x,y) ((x) < (y)? (x) : (y))
109 #endif /* define CLAY_MACROS_H */