build-mac/curl/curlrules.h
changeset 340 ff99a398d872
child 531 a7cc26cc39f2
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/build-mac/curl/curlrules.h	Mon Aug 24 17:23:37 2015 +0200
     1.3 @@ -0,0 +1,262 @@
     1.4 +#ifndef __CURL_CURLRULES_H
     1.5 +#define __CURL_CURLRULES_H
     1.6 +/***************************************************************************
     1.7 + *                                  _   _ ____  _
     1.8 + *  Project                     ___| | | |  _ \| |
     1.9 + *                             / __| | | | |_) | |
    1.10 + *                            | (__| |_| |  _ <| |___
    1.11 + *                             \___|\___/|_| \_\_____|
    1.12 + *
    1.13 + * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
    1.14 + *
    1.15 + * This software is licensed as described in the file COPYING, which
    1.16 + * you should have received as part of this distribution. The terms
    1.17 + * are also available at http://curl.haxx.se/docs/copyright.html.
    1.18 + *
    1.19 + * You may opt to use, copy, modify, merge, publish, distribute and/or sell
    1.20 + * copies of the Software, and permit persons to whom the Software is
    1.21 + * furnished to do so, under the terms of the COPYING file.
    1.22 + *
    1.23 + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
    1.24 + * KIND, either express or implied.
    1.25 + *
    1.26 + ***************************************************************************/
    1.27 +
    1.28 +/* ================================================================ */
    1.29 +/*                    COMPILE TIME SANITY CHECKS                    */
    1.30 +/* ================================================================ */
    1.31 +
    1.32 +/*
    1.33 + * NOTE 1:
    1.34 + * -------
    1.35 + *
    1.36 + * All checks done in this file are intentionally placed in a public
    1.37 + * header file which is pulled by curl/curl.h when an application is
    1.38 + * being built using an already built libcurl library. Additionally
    1.39 + * this file is also included and used when building the library.
    1.40 + *
    1.41 + * If compilation fails on this file it is certainly sure that the
    1.42 + * problem is elsewhere. It could be a problem in the curlbuild.h
    1.43 + * header file, or simply that you are using different compilation
    1.44 + * settings than those used to build the library.
    1.45 + *
    1.46 + * Nothing in this file is intended to be modified or adjusted by the
    1.47 + * curl library user nor by the curl library builder.
    1.48 + *
    1.49 + * Do not deactivate any check, these are done to make sure that the
    1.50 + * library is properly built and used.
    1.51 + *
    1.52 + * You can find further help on the libcurl development mailing list:
    1.53 + * http://cool.haxx.se/mailman/listinfo/curl-library/
    1.54 + *
    1.55 + * NOTE 2
    1.56 + * ------
    1.57 + *
    1.58 + * Some of the following compile time checks are based on the fact
    1.59 + * that the dimension of a constant array can not be a negative one.
    1.60 + * In this way if the compile time verification fails, the compilation
    1.61 + * will fail issuing an error. The error description wording is compiler
    1.62 + * dependent but it will be quite similar to one of the following:
    1.63 + *
    1.64 + *   "negative subscript or subscript is too large"
    1.65 + *   "array must have at least one element"
    1.66 + *   "-1 is an illegal array size"
    1.67 + *   "size of array is negative"
    1.68 + *
    1.69 + * If you are building an application which tries to use an already
    1.70 + * built libcurl library and you are getting this kind of errors on
    1.71 + * this file, it is a clear indication that there is a mismatch between
    1.72 + * how the library was built and how you are trying to use it for your
    1.73 + * application. Your already compiled or binary library provider is the
    1.74 + * only one who can give you the details you need to properly use it.
    1.75 + */
    1.76 +
    1.77 +/*
    1.78 + * Verify that some macros are actually defined.
    1.79 + */
    1.80 +
    1.81 +#ifndef CURL_SIZEOF_LONG
    1.82 +#  error "CURL_SIZEOF_LONG definition is missing!"
    1.83 +   Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing
    1.84 +#endif
    1.85 +
    1.86 +#ifndef CURL_TYPEOF_CURL_SOCKLEN_T
    1.87 +#  error "CURL_TYPEOF_CURL_SOCKLEN_T definition is missing!"
    1.88 +   Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing
    1.89 +#endif
    1.90 +
    1.91 +#ifndef CURL_SIZEOF_CURL_SOCKLEN_T
    1.92 +#  error "CURL_SIZEOF_CURL_SOCKLEN_T definition is missing!"
    1.93 +   Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing
    1.94 +#endif
    1.95 +
    1.96 +#ifndef CURL_TYPEOF_CURL_OFF_T
    1.97 +#  error "CURL_TYPEOF_CURL_OFF_T definition is missing!"
    1.98 +   Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing
    1.99 +#endif
   1.100 +
   1.101 +#ifndef CURL_FORMAT_CURL_OFF_T
   1.102 +#  error "CURL_FORMAT_CURL_OFF_T definition is missing!"
   1.103 +   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing
   1.104 +#endif
   1.105 +
   1.106 +#ifndef CURL_FORMAT_CURL_OFF_TU
   1.107 +#  error "CURL_FORMAT_CURL_OFF_TU definition is missing!"
   1.108 +   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing
   1.109 +#endif
   1.110 +
   1.111 +#ifndef CURL_FORMAT_OFF_T
   1.112 +#  error "CURL_FORMAT_OFF_T definition is missing!"
   1.113 +   Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing
   1.114 +#endif
   1.115 +
   1.116 +#ifndef CURL_SIZEOF_CURL_OFF_T
   1.117 +#  error "CURL_SIZEOF_CURL_OFF_T definition is missing!"
   1.118 +   Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing
   1.119 +#endif
   1.120 +
   1.121 +#ifndef CURL_SUFFIX_CURL_OFF_T
   1.122 +#  error "CURL_SUFFIX_CURL_OFF_T definition is missing!"
   1.123 +   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing
   1.124 +#endif
   1.125 +
   1.126 +#ifndef CURL_SUFFIX_CURL_OFF_TU
   1.127 +#  error "CURL_SUFFIX_CURL_OFF_TU definition is missing!"
   1.128 +   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing
   1.129 +#endif
   1.130 +
   1.131 +/*
   1.132 + * Macros private to this header file.
   1.133 + */
   1.134 +
   1.135 +#define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1
   1.136 +
   1.137 +#define CurlchkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1
   1.138 +
   1.139 +/*
   1.140 + * Verify that the size previously defined and expected for long
   1.141 + * is the same as the one reported by sizeof() at compile time.
   1.142 + */
   1.143 +
   1.144 +typedef char
   1.145 +  __curl_rule_01__
   1.146 +    [CurlchkszEQ(long, CURL_SIZEOF_LONG)];
   1.147 +
   1.148 +/*
   1.149 + * Verify that the size previously defined and expected for
   1.150 + * curl_off_t is actually the the same as the one reported
   1.151 + * by sizeof() at compile time.
   1.152 + */
   1.153 +
   1.154 +typedef char
   1.155 +  __curl_rule_02__
   1.156 +    [CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)];
   1.157 +
   1.158 +/*
   1.159 + * Verify at compile time that the size of curl_off_t as reported
   1.160 + * by sizeof() is greater or equal than the one reported for long
   1.161 + * for the current compilation.
   1.162 + */
   1.163 +
   1.164 +typedef char
   1.165 +  __curl_rule_03__
   1.166 +    [CurlchkszGE(curl_off_t, long)];
   1.167 +
   1.168 +/*
   1.169 + * Verify that the size previously defined and expected for
   1.170 + * curl_socklen_t is actually the the same as the one reported
   1.171 + * by sizeof() at compile time.
   1.172 + */
   1.173 +
   1.174 +typedef char
   1.175 +  __curl_rule_04__
   1.176 +    [CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)];
   1.177 +
   1.178 +/*
   1.179 + * Verify at compile time that the size of curl_socklen_t as reported
   1.180 + * by sizeof() is greater or equal than the one reported for int for
   1.181 + * the current compilation.
   1.182 + */
   1.183 +
   1.184 +typedef char
   1.185 +  __curl_rule_05__
   1.186 +    [CurlchkszGE(curl_socklen_t, int)];
   1.187 +
   1.188 +/* ================================================================ */
   1.189 +/*          EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS           */
   1.190 +/* ================================================================ */
   1.191 +
   1.192 +/*
   1.193 + * CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow
   1.194 + * these to be visible and exported by the external libcurl interface API,
   1.195 + * while also making them visible to the library internals, simply including
   1.196 + * curl_setup.h, without actually needing to include curl.h internally.
   1.197 + * If some day this section would grow big enough, all this should be moved
   1.198 + * to its own header file.
   1.199 + */
   1.200 +
   1.201 +/*
   1.202 + * Figure out if we can use the ## preprocessor operator, which is supported
   1.203 + * by ISO/ANSI C and C++. Some compilers support it without setting __STDC__
   1.204 + * or  __cplusplus so we need to carefully check for them too.
   1.205 + */
   1.206 +
   1.207 +#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \
   1.208 +  defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \
   1.209 +  defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \
   1.210 +  defined(__ILEC400__)
   1.211 +  /* This compiler is believed to have an ISO compatible preprocessor */
   1.212 +#define CURL_ISOCPP
   1.213 +#else
   1.214 +  /* This compiler is believed NOT to have an ISO compatible preprocessor */
   1.215 +#undef CURL_ISOCPP
   1.216 +#endif
   1.217 +
   1.218 +/*
   1.219 + * Macros for minimum-width signed and unsigned curl_off_t integer constants.
   1.220 + */
   1.221 +
   1.222 +#if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551)
   1.223 +#  define __CURL_OFF_T_C_HLPR2(x) x
   1.224 +#  define __CURL_OFF_T_C_HLPR1(x) __CURL_OFF_T_C_HLPR2(x)
   1.225 +#  define CURL_OFF_T_C(Val)  __CURL_OFF_T_C_HLPR1(Val) ## \
   1.226 +                             __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T)
   1.227 +#  define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \
   1.228 +                             __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU)
   1.229 +#else
   1.230 +#  ifdef CURL_ISOCPP
   1.231 +#    define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix
   1.232 +#  else
   1.233 +#    define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix
   1.234 +#  endif
   1.235 +#  define __CURL_OFF_T_C_HLPR1(Val,Suffix) __CURL_OFF_T_C_HLPR2(Val,Suffix)
   1.236 +#  define CURL_OFF_T_C(Val)  __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T)
   1.237 +#  define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU)
   1.238 +#endif
   1.239 +
   1.240 +/*
   1.241 + * Get rid of macros private to this header file.
   1.242 + */
   1.243 +
   1.244 +#undef CurlchkszEQ
   1.245 +#undef CurlchkszGE
   1.246 +
   1.247 +/*
   1.248 + * Get rid of macros not intended to exist beyond this point.
   1.249 + */
   1.250 +
   1.251 +#undef CURL_PULL_WS2TCPIP_H
   1.252 +#undef CURL_PULL_SYS_TYPES_H
   1.253 +#undef CURL_PULL_SYS_SOCKET_H
   1.254 +#undef CURL_PULL_SYS_POLL_H
   1.255 +#undef CURL_PULL_STDINT_H
   1.256 +#undef CURL_PULL_INTTYPES_H
   1.257 +
   1.258 +#undef CURL_TYPEOF_CURL_SOCKLEN_T
   1.259 +#undef CURL_TYPEOF_CURL_OFF_T
   1.260 +
   1.261 +#ifdef CURL_NO_OLDIES
   1.262 +#undef CURL_FORMAT_OFF_T /* not required since 7.19.0 - obsoleted in 7.20.0 */
   1.263 +#endif
   1.264 +
   1.265 +#endif /* __CURL_CURLRULES_H */