1 | /* --------------- */ |
---|
2 | /* --- nrdef.h --- */ |
---|
3 | /* --------------- */ |
---|
4 | |
---|
5 | /* |
---|
6 | * Copyright (c) 2000-2014, Lionel Lacassagne, All rights reserved |
---|
7 | * Univ Paris Sud XI, CNRS |
---|
8 | */ |
---|
9 | |
---|
10 | #ifndef __NRDEF_H__ |
---|
11 | #define __NRDEF_H__ |
---|
12 | |
---|
13 | #ifdef __cplusplus |
---|
14 | extern "C" { |
---|
15 | #endif |
---|
16 | |
---|
17 | //#define NR_VERBOSE_PRAGMA |
---|
18 | // pour affichage de #pragma message("include XXX") |
---|
19 | |
---|
20 | #ifdef NR_VERBOSE_PRAGMA |
---|
21 | #pragma message ("- *** include mypredef.h ***") |
---|
22 | #endif |
---|
23 | |
---|
24 | /* ------------------- */ |
---|
25 | /* --- Exportation --- */ |
---|
26 | /* ------------------- */ |
---|
27 | #define NRC_EXPORT(x) x |
---|
28 | #define IMAGE_EXPORT(x) x |
---|
29 | #define ROUTINE(x) x |
---|
30 | #define NRC_ROUTINE(x) x |
---|
31 | |
---|
32 | /* --------------------- */ |
---|
33 | /* --- Progress Info --- */ |
---|
34 | /* --------------------- */ |
---|
35 | |
---|
36 | #define NR_PROGRESS_INFO_ENABLED |
---|
37 | |
---|
38 | #ifdef NR_PROGRESS_INFO_ENABLED |
---|
39 | #define NR_PROGRESS_INFO(str, i, i0, i1) // ProgressInfo(str, i,i0, i1); |
---|
40 | #else |
---|
41 | #define NR_PROGRESS_INFO(str, i, i0, i1) // no progress |
---|
42 | #endif |
---|
43 | |
---|
44 | /* ------------- */ |
---|
45 | /* --- Debug --- */ |
---|
46 | /* ------------- */ |
---|
47 | |
---|
48 | #define NEW(x) |
---|
49 | |
---|
50 | #ifdef _DEBUG |
---|
51 | |
---|
52 | #ifdef VERBOSE_PRAGMA |
---|
53 | #pragma message ("Info : DEBUG is ON") |
---|
54 | #endif |
---|
55 | |
---|
56 | #define LL_DEBUG(x) x |
---|
57 | #define DEBUG(x) x |
---|
58 | #define VERBOSE(x) x |
---|
59 | #define LL_OPTIMIZE(x) |
---|
60 | //#define FUNCTION_NAME(x) NameFunction(x) |
---|
61 | #define FUNCTION_NAME(x) |
---|
62 | #define NAME_FUNCTION(x) |
---|
63 | |
---|
64 | #endif // _DEBUG |
---|
65 | |
---|
66 | /* --------------- */ |
---|
67 | /* --- Release --- */ |
---|
68 | /* --------------- */ |
---|
69 | |
---|
70 | #ifdef NDEBUG |
---|
71 | |
---|
72 | #ifdef VERBOSE_PRAGMA |
---|
73 | #pragma message ("Info : DEBUG is OFF") |
---|
74 | #endif |
---|
75 | |
---|
76 | #define LL_DEBUG(x) |
---|
77 | #define DEBUG(x) |
---|
78 | #define VERBOSE(x) |
---|
79 | #define LL_OPTIMIZE(x) x |
---|
80 | #define FUNCTION_NAME(x) |
---|
81 | #define NAME_FUNCTION(x) |
---|
82 | |
---|
83 | #endif // NDEBUG |
---|
84 | |
---|
85 | /* --------------------- */ |
---|
86 | /* --- Error Handler --- */ |
---|
87 | /* --------------------- */ |
---|
88 | #define RCCHECK(rc) if(rc) return rc; |
---|
89 | |
---|
90 | /* ---------------- */ |
---|
91 | /* --- Modifier --- */ |
---|
92 | /* ---------------- */ |
---|
93 | #ifndef ROUTINE |
---|
94 | #ifndef _cplusplus |
---|
95 | |
---|
96 | |
---|
97 | #ifdef WIN32 |
---|
98 | #define ROUTINE __inline |
---|
99 | #define ROUTINE_EXPORT(X) __inline x |
---|
100 | #define GPC_ROUTINE_EXPORT(x) __inline x __stdcall |
---|
101 | #else |
---|
102 | #define ROUTINE |
---|
103 | #define ROUTINE_EXPORT(X) x |
---|
104 | #define GPC_ROUTINE_EXPORT(x) x |
---|
105 | #endif |
---|
106 | |
---|
107 | #else |
---|
108 | |
---|
109 | #define ROUTINE inline |
---|
110 | #define ROUTINE_EXPORT(X) inline x |
---|
111 | #define GPC_ROUTINE_EXPORT(x) inline x __stdcall |
---|
112 | #endif |
---|
113 | #endif |
---|
114 | |
---|
115 | #ifndef PRIVATE |
---|
116 | #define PRIVATE static |
---|
117 | #else |
---|
118 | #pragma message(" ATTENTION : PRIVATE already defined") |
---|
119 | #endif |
---|
120 | |
---|
121 | #ifndef PUBLIC |
---|
122 | #define PUBLIC |
---|
123 | #else |
---|
124 | #pragma message(" ATTENTION : PUBLIC already defined") |
---|
125 | #endif |
---|
126 | |
---|
127 | /*#ifndef BOOLEAN |
---|
128 | #define BOOLEAN int |
---|
129 | #else |
---|
130 | #pragma message(" ATTENTION : BOOLEAN already defined") |
---|
131 | #endif*/ |
---|
132 | |
---|
133 | /* ---------- */ |
---|
134 | /* --- PI --- */ |
---|
135 | /* ---------- */ |
---|
136 | // for the fun |
---|
137 | #define PI 3.1415926535897932384626433832795028841972 |
---|
138 | /* pi par Donald E. Knuth |
---|
139 | * PI 3.14159.26535.89793.23846.26433.83279.50288.41972 |
---|
140 | */ |
---|
141 | |
---|
142 | /* ------------------- */ |
---|
143 | /* --- end of file --- */ |
---|
144 | /* ------------------- */ |
---|
145 | |
---|
146 | #ifdef __cplusplus |
---|
147 | } |
---|
148 | #endif |
---|
149 | |
---|
150 | #endif // __NRDEF_H__ |
---|