curlrules.h
Go to the documentation of this file.
00001 #ifndef __CURL_CURLRULES_H
00002 #define __CURL_CURLRULES_H
00003 /***************************************************************************
00004  *                                  _   _ ____  _
00005  *  Project                     ___| | | |  _ \| |
00006  *                             / __| | | | |_) | |
00007  *                            | (__| |_| |  _ <| |___
00008  *                             \___|\___/|_| \_\_____|
00009  *
00010  * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
00011  *
00012  * This software is licensed as described in the file COPYING, which
00013  * you should have received as part of this distribution. The terms
00014  * are also available at https://curl.haxx.se/docs/copyright.html.
00015  *
00016  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
00017  * copies of the Software, and permit persons to whom the Software is
00018  * furnished to do so, under the terms of the COPYING file.
00019  *
00020  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
00021  * KIND, either express or implied.
00022  *
00023  ***************************************************************************/
00024 
00025 /* ================================================================ */
00026 /*                    COMPILE TIME SANITY CHECKS                    */
00027 /* ================================================================ */
00028 
00029 /*
00030  * NOTE 1:
00031  * -------
00032  *
00033  * All checks done in this file are intentionally placed in a public
00034  * header file which is pulled by curl/curl.h when an application is
00035  * being built using an already built libcurl library. Additionally
00036  * this file is also included and used when building the library.
00037  *
00038  * If compilation fails on this file it is certainly sure that the
00039  * problem is elsewhere. It could be a problem in the curlbuild.h
00040  * header file, or simply that you are using different compilation
00041  * settings than those used to build the library.
00042  *
00043  * Nothing in this file is intended to be modified or adjusted by the
00044  * curl library user nor by the curl library builder.
00045  *
00046  * Do not deactivate any check, these are done to make sure that the
00047  * library is properly built and used.
00048  *
00049  * You can find further help on the libcurl development mailing list:
00050  * https://cool.haxx.se/mailman/listinfo/curl-library/
00051  *
00052  * NOTE 2
00053  * ------
00054  *
00055  * Some of the following compile time checks are based on the fact
00056  * that the dimension of a constant array can not be a negative one.
00057  * In this way if the compile time verification fails, the compilation
00058  * will fail issuing an error. The error description wording is compiler
00059  * dependent but it will be quite similar to one of the following:
00060  *
00061  *   "negative subscript or subscript is too large"
00062  *   "array must have at least one element"
00063  *   "-1 is an illegal array size"
00064  *   "size of array is negative"
00065  *
00066  * If you are building an application which tries to use an already
00067  * built libcurl library and you are getting this kind of errors on
00068  * this file, it is a clear indication that there is a mismatch between
00069  * how the library was built and how you are trying to use it for your
00070  * application. Your already compiled or binary library provider is the
00071  * only one who can give you the details you need to properly use it.
00072  */
00073 
00074 /*
00075  * Verify that some macros are actually defined.
00076  */
00077 
00078 #ifndef CURL_SIZEOF_LONG
00079 #  error "CURL_SIZEOF_LONG definition is missing!"
00080    Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing
00081 #endif
00082 
00083 #ifndef CURL_TYPEOF_CURL_SOCKLEN_T
00084 #  error "CURL_TYPEOF_CURL_SOCKLEN_T definition is missing!"
00085    Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing
00086 #endif
00087 
00088 #ifndef CURL_SIZEOF_CURL_SOCKLEN_T
00089 #  error "CURL_SIZEOF_CURL_SOCKLEN_T definition is missing!"
00090    Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing
00091 #endif
00092 
00093 #ifndef CURL_TYPEOF_CURL_OFF_T
00094 #  error "CURL_TYPEOF_CURL_OFF_T definition is missing!"
00095    Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing
00096 #endif
00097 
00098 #ifndef CURL_FORMAT_CURL_OFF_T
00099 #  error "CURL_FORMAT_CURL_OFF_T definition is missing!"
00100    Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing
00101 #endif
00102 
00103 #ifndef CURL_FORMAT_CURL_OFF_TU
00104 #  error "CURL_FORMAT_CURL_OFF_TU definition is missing!"
00105    Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing
00106 #endif
00107 
00108 #ifndef CURL_FORMAT_OFF_T
00109 #  error "CURL_FORMAT_OFF_T definition is missing!"
00110    Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing
00111 #endif
00112 
00113 #ifndef CURL_SIZEOF_CURL_OFF_T
00114 #  error "CURL_SIZEOF_CURL_OFF_T definition is missing!"
00115    Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing
00116 #endif
00117 
00118 #ifndef CURL_SUFFIX_CURL_OFF_T
00119 #  error "CURL_SUFFIX_CURL_OFF_T definition is missing!"
00120    Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing
00121 #endif
00122 
00123 #ifndef CURL_SUFFIX_CURL_OFF_TU
00124 #  error "CURL_SUFFIX_CURL_OFF_TU definition is missing!"
00125    Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing
00126 #endif
00127 
00128 /*
00129  * Macros private to this header file.
00130  */
00131 
00132 #define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1
00133 
00134 #define CurlchkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1
00135 
00136 /*
00137  * Verify that the size previously defined and expected for long
00138  * is the same as the one reported by sizeof() at compile time.
00139  */
00140 
00141 typedef char
00142   __curl_rule_01__
00143     [CurlchkszEQ(long, CURL_SIZEOF_LONG)];
00144 
00145 /*
00146  * Verify that the size previously defined and expected for
00147  * curl_off_t is actually the the same as the one reported
00148  * by sizeof() at compile time.
00149  */
00150 
00151 typedef char
00152   __curl_rule_02__
00153     [CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)];
00154 
00155 /*
00156  * Verify at compile time that the size of curl_off_t as reported
00157  * by sizeof() is greater or equal than the one reported for long
00158  * for the current compilation.
00159  */
00160 
00161 typedef char
00162   __curl_rule_03__
00163     [CurlchkszGE(curl_off_t, long)];
00164 
00165 /*
00166  * Verify that the size previously defined and expected for
00167  * curl_socklen_t is actually the the same as the one reported
00168  * by sizeof() at compile time.
00169  */
00170 
00171 typedef char
00172   __curl_rule_04__
00173     [CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)];
00174 
00175 /*
00176  * Verify at compile time that the size of curl_socklen_t as reported
00177  * by sizeof() is greater or equal than the one reported for int for
00178  * the current compilation.
00179  */
00180 
00181 typedef char
00182   __curl_rule_05__
00183     [CurlchkszGE(curl_socklen_t, int)];
00184 
00185 /* ================================================================ */
00186 /*          EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS           */
00187 /* ================================================================ */
00188 
00189 /*
00190  * CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow
00191  * these to be visible and exported by the external libcurl interface API,
00192  * while also making them visible to the library internals, simply including
00193  * curl_setup.h, without actually needing to include curl.h internally.
00194  * If some day this section would grow big enough, all this should be moved
00195  * to its own header file.
00196  */
00197 
00198 /*
00199  * Figure out if we can use the ## preprocessor operator, which is supported
00200  * by ISO/ANSI C and C++. Some compilers support it without setting __STDC__
00201  * or  __cplusplus so we need to carefully check for them too.
00202  */
00203 
00204 #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \
00205   defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \
00206   defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \
00207   defined(__ILEC400__)
00208   /* This compiler is believed to have an ISO compatible preprocessor */
00209 #define CURL_ISOCPP
00210 #else
00211   /* This compiler is believed NOT to have an ISO compatible preprocessor */
00212 #undef CURL_ISOCPP
00213 #endif
00214 
00215 /*
00216  * Macros for minimum-width signed and unsigned curl_off_t integer constants.
00217  */
00218 
00219 #if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551)
00220 #  define __CURL_OFF_T_C_HLPR2(x) x
00221 #  define __CURL_OFF_T_C_HLPR1(x) __CURL_OFF_T_C_HLPR2(x)
00222 #  define CURL_OFF_T_C(Val)  __CURL_OFF_T_C_HLPR1(Val) ## \
00223                              __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T)
00224 #  define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \
00225                              __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU)
00226 #else
00227 #  ifdef CURL_ISOCPP
00228 #    define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix
00229 #  else
00230 #    define __CURL_OFF_T_C_HLPR2(Val,Suffix) ValSuffix
00231 #  endif
00232 #  define __CURL_OFF_T_C_HLPR1(Val,Suffix) __CURL_OFF_T_C_HLPR2(Val,Suffix)
00233 #  define CURL_OFF_T_C(Val)  __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T)
00234 #  define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU)
00235 #endif
00236 
00237 /*
00238  * Get rid of macros private to this header file.
00239  */
00240 
00241 #undef CurlchkszEQ
00242 #undef CurlchkszGE
00243 
00244 /*
00245  * Get rid of macros not intended to exist beyond this point.
00246  */
00247 
00248 #undef CURL_PULL_WS2TCPIP_H
00249 #undef CURL_PULL_SYS_TYPES_H
00250 #undef CURL_PULL_SYS_SOCKET_H
00251 #undef CURL_PULL_SYS_POLL_H
00252 #undef CURL_PULL_STDINT_H
00253 #undef CURL_PULL_INTTYPES_H
00254 
00255 #undef CURL_TYPEOF_CURL_SOCKLEN_T
00256 #undef CURL_TYPEOF_CURL_OFF_T
00257 
00258 #ifdef CURL_NO_OLDIES
00259 #undef CURL_FORMAT_OFF_T /* not required since 7.19.0 - obsoleted in 7.20.0 */
00260 #endif
00261 
00262 #endif /* __CURL_CURLRULES_H */


rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:02