1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/crashreporter/google-breakpad/src/third_party/curl/curlrules.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,249 @@ 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 - 2009, 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 + * $Id: curlrules.h,v 1.7 2009-10-27 16:56:20 yangtse Exp $ 1.27 + ***************************************************************************/ 1.28 + 1.29 +/* ================================================================ */ 1.30 +/* COMPILE TIME SANITY CHECKS */ 1.31 +/* ================================================================ */ 1.32 + 1.33 +/* 1.34 + * NOTE 1: 1.35 + * ------- 1.36 + * 1.37 + * All checks done in this file are intentionally placed in a public 1.38 + * header file which is pulled by curl/curl.h when an application is 1.39 + * being built using an already built libcurl library. Additionally 1.40 + * this file is also included and used when building the library. 1.41 + * 1.42 + * If compilation fails on this file it is certainly sure that the 1.43 + * problem is elsewhere. It could be a problem in the curlbuild.h 1.44 + * header file, or simply that you are using different compilation 1.45 + * settings than those used to build the library. 1.46 + * 1.47 + * Nothing in this file is intended to be modified or adjusted by the 1.48 + * curl library user nor by the curl library builder. 1.49 + * 1.50 + * Do not deactivate any check, these are done to make sure that the 1.51 + * library is properly built and used. 1.52 + * 1.53 + * You can find further help on the libcurl development mailing list: 1.54 + * http://cool.haxx.se/mailman/listinfo/curl-library/ 1.55 + * 1.56 + * NOTE 2 1.57 + * ------ 1.58 + * 1.59 + * Some of the following compile time checks are based on the fact 1.60 + * that the dimension of a constant array can not be a negative one. 1.61 + * In this way if the compile time verification fails, the compilation 1.62 + * will fail issuing an error. The error description wording is compiler 1.63 + * dependent but it will be quite similar to one of the following: 1.64 + * 1.65 + * "negative subscript or subscript is too large" 1.66 + * "array must have at least one element" 1.67 + * "-1 is an illegal array size" 1.68 + * "size of array is negative" 1.69 + * 1.70 + * If you are building an application which tries to use an already 1.71 + * built libcurl library and you are getting this kind of errors on 1.72 + * this file, it is a clear indication that there is a mismatch between 1.73 + * how the library was built and how you are trying to use it for your 1.74 + * application. Your already compiled or binary library provider is the 1.75 + * only one who can give you the details you need to properly use it. 1.76 + */ 1.77 + 1.78 +/* 1.79 + * Verify that some macros are actually defined. 1.80 + */ 1.81 + 1.82 +#ifndef CURL_SIZEOF_LONG 1.83 +# error "CURL_SIZEOF_LONG definition is missing!" 1.84 + Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing 1.85 +#endif 1.86 + 1.87 +#ifndef CURL_TYPEOF_CURL_SOCKLEN_T 1.88 +# error "CURL_TYPEOF_CURL_SOCKLEN_T definition is missing!" 1.89 + Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing 1.90 +#endif 1.91 + 1.92 +#ifndef CURL_SIZEOF_CURL_SOCKLEN_T 1.93 +# error "CURL_SIZEOF_CURL_SOCKLEN_T definition is missing!" 1.94 + Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing 1.95 +#endif 1.96 + 1.97 +#ifndef CURL_TYPEOF_CURL_OFF_T 1.98 +# error "CURL_TYPEOF_CURL_OFF_T definition is missing!" 1.99 + Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing 1.100 +#endif 1.101 + 1.102 +#ifndef CURL_FORMAT_CURL_OFF_T 1.103 +# error "CURL_FORMAT_CURL_OFF_T definition is missing!" 1.104 + Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing 1.105 +#endif 1.106 + 1.107 +#ifndef CURL_FORMAT_CURL_OFF_TU 1.108 +# error "CURL_FORMAT_CURL_OFF_TU definition is missing!" 1.109 + Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing 1.110 +#endif 1.111 + 1.112 +#ifndef CURL_FORMAT_OFF_T 1.113 +# error "CURL_FORMAT_OFF_T definition is missing!" 1.114 + Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing 1.115 +#endif 1.116 + 1.117 +#ifndef CURL_SIZEOF_CURL_OFF_T 1.118 +# error "CURL_SIZEOF_CURL_OFF_T definition is missing!" 1.119 + Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing 1.120 +#endif 1.121 + 1.122 +#ifndef CURL_SUFFIX_CURL_OFF_T 1.123 +# error "CURL_SUFFIX_CURL_OFF_T definition is missing!" 1.124 + Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing 1.125 +#endif 1.126 + 1.127 +#ifndef CURL_SUFFIX_CURL_OFF_TU 1.128 +# error "CURL_SUFFIX_CURL_OFF_TU definition is missing!" 1.129 + Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing 1.130 +#endif 1.131 + 1.132 +/* 1.133 + * Macros private to this header file. 1.134 + */ 1.135 + 1.136 +#define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1 1.137 + 1.138 +#define CurlchkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1 1.139 + 1.140 +/* 1.141 + * Verify that the size previously defined and expected for long 1.142 + * is the same as the one reported by sizeof() at compile time. 1.143 + */ 1.144 + 1.145 +typedef char 1.146 + __curl_rule_01__ 1.147 + [CurlchkszEQ(long, CURL_SIZEOF_LONG)]; 1.148 + 1.149 +/* 1.150 + * Verify that the size previously defined and expected for 1.151 + * curl_off_t is actually the the same as the one reported 1.152 + * by sizeof() at compile time. 1.153 + */ 1.154 + 1.155 +typedef char 1.156 + __curl_rule_02__ 1.157 + [CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)]; 1.158 + 1.159 +/* 1.160 + * Verify at compile time that the size of curl_off_t as reported 1.161 + * by sizeof() is greater or equal than the one reported for long 1.162 + * for the current compilation. 1.163 + */ 1.164 + 1.165 +typedef char 1.166 + __curl_rule_03__ 1.167 + [CurlchkszGE(curl_off_t, long)]; 1.168 + 1.169 +/* 1.170 + * Verify that the size previously defined and expected for 1.171 + * curl_socklen_t is actually the the same as the one reported 1.172 + * by sizeof() at compile time. 1.173 + */ 1.174 + 1.175 +typedef char 1.176 + __curl_rule_04__ 1.177 + [CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)]; 1.178 + 1.179 +/* 1.180 + * Verify at compile time that the size of curl_socklen_t as reported 1.181 + * by sizeof() is greater or equal than the one reported for int for 1.182 + * the current compilation. 1.183 + */ 1.184 + 1.185 +typedef char 1.186 + __curl_rule_05__ 1.187 + [CurlchkszGE(curl_socklen_t, int)]; 1.188 + 1.189 +/* ================================================================ */ 1.190 +/* EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS */ 1.191 +/* ================================================================ */ 1.192 + 1.193 +/* 1.194 + * CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow 1.195 + * these to be visible and exported by the external libcurl interface API, 1.196 + * while also making them visible to the library internals, simply including 1.197 + * setup.h, without actually needing to include curl.h internally. 1.198 + * If some day this section would grow big enough, all this should be moved 1.199 + * to its own header file. 1.200 + */ 1.201 + 1.202 +/* 1.203 + * Figure out if we can use the ## preprocessor operator, which is supported 1.204 + * by ISO/ANSI C and C++. Some compilers support it without setting __STDC__ 1.205 + * or __cplusplus so we need to carefully check for them too. 1.206 + */ 1.207 + 1.208 +#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \ 1.209 + defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \ 1.210 + defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \ 1.211 + defined(__ILEC400__) 1.212 + /* This compiler is believed to have an ISO compatible preprocessor */ 1.213 +#define CURL_ISOCPP 1.214 +#else 1.215 + /* This compiler is believed NOT to have an ISO compatible preprocessor */ 1.216 +#undef CURL_ISOCPP 1.217 +#endif 1.218 + 1.219 +/* 1.220 + * Macros for minimum-width signed and unsigned curl_off_t integer constants. 1.221 + */ 1.222 + 1.223 +#ifdef CURL_ISOCPP 1.224 +# define __CURL_OFF_T_C_HELPER2(Val,Suffix) Val ## Suffix 1.225 +#else 1.226 +# define __CURL_OFF_T_C_HELPER2(Val,Suffix) Val/**/Suffix 1.227 +#endif 1.228 +#define __CURL_OFF_T_C_HELPER1(Val,Suffix) __CURL_OFF_T_C_HELPER2(Val,Suffix) 1.229 +#define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HELPER1(Val,CURL_SUFFIX_CURL_OFF_T) 1.230 +#define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HELPER1(Val,CURL_SUFFIX_CURL_OFF_TU) 1.231 + 1.232 +/* 1.233 + * Get rid of macros private to this header file. 1.234 + */ 1.235 + 1.236 +#undef CurlchkszEQ 1.237 +#undef CurlchkszGE 1.238 + 1.239 +/* 1.240 + * Get rid of macros not intended to exist beyond this point. 1.241 + */ 1.242 + 1.243 +#undef CURL_PULL_WS2TCPIP_H 1.244 +#undef CURL_PULL_SYS_TYPES_H 1.245 +#undef CURL_PULL_SYS_SOCKET_H 1.246 +#undef CURL_PULL_STDINT_H 1.247 +#undef CURL_PULL_INTTYPES_H 1.248 + 1.249 +#undef CURL_TYPEOF_CURL_SOCKLEN_T 1.250 +#undef CURL_TYPEOF_CURL_OFF_T 1.251 + 1.252 +#endif /* __CURL_CURLRULES_H */