summaryrefslogtreecommitdiff
path: root/ares_rules.h
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-06-15 10:55:29 +0200
committerJakub Hrozek <jhrozek@redhat.com>2011-06-15 10:55:29 +0200
commitce03c818f4f0474237abdd881450ef7e468306a5 (patch)
tree7c1456664f7e6af577f861a2281c49eb225f517d /ares_rules.h
parent22c527cc87438d219fd3a7df73fa54bd6a78a787 (diff)
downloadc-ares-ce03c818f4f0474237abdd881450ef7e468306a5.tar.gz
c-ares-ce03c818f4f0474237abdd881450ef7e468306a5.tar.bz2
c-ares-ce03c818f4f0474237abdd881450ef7e468306a5.zip
Revert "Do not use sized constants in public headers"
This reverts commit 22c01e96f7b2ae9923e1baa50bfe3c0d22297a7d. This is a Red Hat specific patch that does not belong into upstream
Diffstat (limited to 'ares_rules.h')
-rw-r--r--ares_rules.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/ares_rules.h b/ares_rules.h
index 334af51..f94c5b5 100644
--- a/ares_rules.h
+++ b/ares_rules.h
@@ -68,11 +68,21 @@
* Verify that some macros are actually defined.
*/
+#ifndef CARES_SIZEOF_LONG
+# error "CARES_SIZEOF_LONG definition is missing!"
+ Error Compilation_aborted_CARES_SIZEOF_LONG_is_missing
+#endif
+
#ifndef CARES_TYPEOF_ARES_SOCKLEN_T
# error "CARES_TYPEOF_ARES_SOCKLEN_T definition is missing!"
Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_is_missing
#endif
+#ifndef CARES_SIZEOF_ARES_SOCKLEN_T
+# error "CARES_SIZEOF_ARES_SOCKLEN_T definition is missing!"
+ Error Compilation_aborted_CARES_SIZEOF_ARES_SOCKLEN_T_is_missing
+#endif
+
/*
* Macros private to this header file.
*/
@@ -82,6 +92,25 @@
#define CareschkszGE(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
+ __cares_rule_01__
+ [CareschkszEQ(long, CARES_SIZEOF_LONG)];
+
+/*
+ * Verify that the size previously defined and expected for
+ * ares_socklen_t is actually the the same as the one reported
+ * by sizeof() at compile time.
+ */
+
+typedef char
+ __cares_rule_02__
+ [CareschkszEQ(ares_socklen_t, CARES_SIZEOF_ARES_SOCKLEN_T)];
+
+/*
* Verify at compile time that the size of ares_socklen_t as reported
* by sizeof() is greater or equal than the one reported for int for
* the current compilation.