summaryrefslogtreecommitdiff
path: root/include/curl/curlrules.h
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-08-13 15:32:20 +0000
committerYang Tse <yangsita@gmail.com>2008-08-13 15:32:20 +0000
commitfeb03e471786e9c543ef6e807a4a748046c0ce2b (patch)
treeb2c7571bd167c31f8702240a0e9c6f1fec295df5 /include/curl/curlrules.h
parent64e3a091c34482b666c3c50c312829cd7fa140c9 (diff)
downloadcurl-feb03e471786e9c543ef6e807a4a748046c0ce2b.tar.gz
The size of long is a build time characteristic and as such it is now recorded
in curlbuild.h as CURL_SIZEOF_LONG. Definition now done from configure process and in CVS curlbuild.h.dist for non-configure systems.
Diffstat (limited to 'include/curl/curlrules.h')
-rw-r--r--include/curl/curlrules.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/include/curl/curlrules.h b/include/curl/curlrules.h
index cda33b21b..4a7671fcd 100644
--- a/include/curl/curlrules.h
+++ b/include/curl/curlrules.h
@@ -76,6 +76,11 @@
* Verify that some macros are actually defined.
*/
+#ifndef CURL_SIZEOF_LONG
+# error "CURL_SIZEOF_LONG definition is missing!"
+ Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing
+#endif
+
#ifndef CURL_OFF_T
# error "CURL_OFF_T definition is missing!"
Error Compilation_aborted_CURL_OFF_T_is_missing
@@ -120,13 +125,22 @@
#define CurlchkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1
/*
+ * Verify that the size previously defined and expected for long
+ * is the same as the one reported by sizeof() at compile time.
+ */
+
+typedef char
+ __curl_rule_01__
+ [CurlchkszEQ(long, CURL_SIZEOF_LONG)];
+
+/*
* Verify that the size previously defined and expected for
* curl_off_t is actually the the same as the one reported
* by sizeof() at compile time.
*/
typedef char
- __curl_rule_01__
+ __curl_rule_02__
[CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)];
/*
@@ -136,7 +150,7 @@ typedef char
*/
typedef char
- __curl_rule_02__
+ __curl_rule_03__
[CurlchkszGE(curl_off_t, long)];
/* ================================================================ */