NCBI C++ ToolKit
ncbilcl.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef _NCBILCL_
2 #define _NCBILCL_
3 
4 /* $Id: ncbilcl.hpp 80115 2017-11-08 12:52:45Z ivanov $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Vladimir Ivanov
30  *
31  * File Description:
32  * Redefine C Toolkit configuration macros using C++ Toolkit definitions
33  *
34  */
35 
36 
37 /// Define ctransition namespace, and defang ncbi_skew_guard.h.
38 
39 #define CTRANSITION_NS ctransition
40 
41 #include <corelib/ncbistl.hpp>
42 
43 /** @addtogroup CToolsBridge
44  *
45  * @{
46  */
47 
48 
49 #define BEGIN_CTRANSITION_SCOPE BEGIN_SCOPE(CTRANSITION_NS)
50 #define END_CTRANSITION_SCOPE END_SCOPE(CTRANSITION_NS)
51 #define USING_CTRANSITION_SCOPE USING_SCOPE(CTRANSITION_NS)
52 
53 
54 /*----------------------------------------------------------------------*/
55 /* OS */
56 /*----------------------------------------------------------------------*/
57 
58 #ifdef NCBI_OS_UNIX
59 # define OS_UNIX
60 #endif
61 
62 #ifdef NCBI_OS_MSWIN
63 # define OS_MSWIN
64 #endif
65 
66 #ifdef NCBI_OS_BSD
67 # define OS_UNIX_FREEBSD
68 #endif
69 
70 #ifdef NCBI_OS_DARWIN
71 # define OS_UNIX_DARWIN
72 #endif
73 
74 #ifdef NCBI_OS_LINUX
75 # define OS_UNIX_LINUX
76 #endif
77 
78 
79 /* Define to 1 on Cygwin. */
80 /* #undef NCBI_OS_CYGWIN */
81 
82 
83 /*----------------------------------------------------------------------*/
84 /* Compiler */
85 /*----------------------------------------------------------------------*/
86 
87 
88 #ifdef NCBI_COMPILER_MSVC
89 # define COMP_MSC
90 #endif
91 
92 #ifdef NCBI_COMPILER_GCC
93 # define COMP_GNU
94 #endif
95 
96 
97 /*----------------------------------------------------------------------*/
98 /* Desired or available feature list */
99 /*----------------------------------------------------------------------*/
100 
101 // C++ Toolkit have the same definitions
102 //#define HAVE_STRCASECMP 1
103 //#define HAVE_STRDUP 1
104 
105 
106 /*----------------------------------------------------------------------*/
107 /* #includes */
108 /*----------------------------------------------------------------------*/
109 
110 #if defined(NCBI_OS_UNIX)
111 # include <sys/types.h>
112 # include <limits.h>
113 # include <sys/stat.h>
114 # include <stddef.h>
115 # include <stdio.h>
116 # include <ctype.h>
117 # include <string.h>
118 //# include <malloc.h>
119 # include <memory.h>
120 # include <stdlib.h>
121 # include <math.h>
122 # include <errno.h>
123 # include <float.h>
124 # include <unistd.h>
125 #endif
126 
127 #if defined(NCBI_OS_MSWIN)
128 # include <stddef.h>
129 # include <sys/types.h>
130 # include <limits.h>
131 # include <sys/stat.h>
132 # include <stdio.h>
133 # include <ctype.h>
134 # include <string.h>
135 # include <stdlib.h>
136 # include <math.h>
137 # include <errno.h>
138 # include <float.h>
139 #endif
140 
141 
142 /*----------------------------------------------------------------------*/
143 /* Missing ANSI-isms */
144 /*----------------------------------------------------------------------*/
145 
146 #if 0
147 
148 #ifndef offsetof
149 #define offsetof(__strctr,__fld) ((size_t)(&(((__strctr *)0)->__fld)))
150 #endif
151 
152 #ifndef CLK_TCK
153 # define CLK_TCK 60
154 #endif
155 #ifndef SEEK_SET
156 # define SEEK_SET 0
157 # define SEEK_CUR 1
158 # define SEEK_END 2
159 #endif
160 
161 #ifndef FILENAME_MAX
162 # if defined(NCBI_OS_UNIX)
163 # define FILENAME_MAX 1024
164 # elif
165 # define FILENAME_MAX 63
166 # endif
167 #endif
168 #ifndef PATH_MAX
169 # if defined(NCBI_OS_UNIX)
170 # define PATH_MAX 1024
171 # elif
172 # define PATH_MAX 256
173 # endif
174 #endif
175 
176 #endif /* 0 */
177 
178 
179 /*----------------------------------------------------------------------*/
180 /* Misc Macros */
181 /*----------------------------------------------------------------------*/
182 
183 #define PROTO(x) x
184 #define VPROTO(x) x
185 
186 #define INLINE inline
187 
188 #if 0
189 
190 #ifdef NCBI_OS_MSWIN
191 # define DIRDELIMCHR '\\'
192 # define DIRDELIMSTR "\\"
193 #else
194 # define DIRDELIMCHR '/'
195 # define DIRDELIMSTR "/"
196 #endif
197 #define CWDSTR "."
198 
199 #define KBYTE (1024)
200 #define MBYTE (1048576)
201 
202 #define TEMPNAM_AVAIL
203 /*#define HAVE_MADVISE*/
204 
205 #if defined(WORDS_BIGENDIAN)
206 # define IS_BIG_ENDIAN
207 #elif
208 # define IS_LITTLE_ENDIAN
209 #endif
210 
211 #endif /* 0 */
212 
213 
214 
215 /*----------------------------------------------------------------------*/
216 /* Macros for Floating Point */
217 /*----------------------------------------------------------------------*/
218 
219 /*
220 #if defined(NCBI_OS_DARWIN) || defined(OS_UNIX_LINUX) || defined(NCBI_OS_MSWIN)
221 # define EXP2(x) exp((x)*LN2)
222 # define LOG2(x) (log(x)*(1./LN2))
223 # define EXP10(x) exp((x)*LN10)
224 # define LOG10(x) log10(x)
225 #endif
226 
227 #if defined(???)
228 # define EXP2(x) exp2(x)
229 # define LOG2(x) log2(x)
230 # define EXP10(x) exp10(x)
231 # define LOG10(x) log10(x)
232 #endif
233 */
234 
235 
236 /*----------------------------------------------------------------------*/
237 /* Macros Defining Limits */
238 /*----------------------------------------------------------------------*/
239 
240 /* Largest permissible memory request */
241 /*
242 #ifdef NCBI_OS_MSWIN
243 # define MAXALLOC 0x7F000000
244 #else
245 # define MAXALLOC 0x40000000
246 #endif
247 */
248 
249 
250 
251 /* @} */
252 
253 #endif /* _NCBILCL_ */
The NCBI C++/STL use hints.
Modified on Fri Sep 20 14:58:05 2024 by modify_doxy.py rev. 669887