From cb6f7ea40ecd8b1d26ba94f2ee0631f049a9a7cc Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 13 Mar 2012 23:54:27 -0400 Subject: [PATCH] do not include stdint.h unprotected In most cases stdint.h should be inherited from roken.h. In those cases where it cannot be, it must be protected by #ifdef HAVE_STDINT_H Change-Id: I46cbaeab1d65939468f84179aeeef7e4f898b0bb --- lib/asn1/der.h | 2 +- lib/asn1/gen.c | 6 +++++- lib/asn1/heim_asn1.h | 2 +- lib/asn1/symbol.h | 2 +- lib/roken/roken.h.in | 2 ++ lib/roken/strtoll.c | 1 - lib/roken/strtoull.c | 1 - 7 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/asn1/der.h b/lib/asn1/der.h index f73234864..84be00c17 100644 --- a/lib/asn1/der.h +++ b/lib/asn1/der.h @@ -36,7 +36,7 @@ #ifndef __DER_H__ #define __DER_H__ -#include +#include typedef enum { ASN1_C_UNIV = 0, diff --git a/lib/asn1/gen.c b/lib/asn1/gen.c index ea459de17..37ad42bbe 100644 --- a/lib/asn1/gen.c +++ b/lib/asn1/gen.c @@ -264,7 +264,9 @@ init_generate (const char *filename, const char *base) "/* Do not edit */\n\n" "#include \n" "#include \n" + "#ifdef HAVE_STDINT_H\n" "#include \n" + "#endif\n" "#include \n" "#include \n" "#include \n" @@ -364,7 +366,9 @@ generate_header_of_codefile(const char *name) "#define ASN1_LIB\n\n" "#include \n" "#include \n" - "#include \n" + "#ifdef HAVE_STDINT_H\n" + "#include \n" + "#endif\n" "#include \n" "#include \n" "#include \n" diff --git a/lib/asn1/heim_asn1.h b/lib/asn1/heim_asn1.h index 23041251b..50bdfefea 100644 --- a/lib/asn1/heim_asn1.h +++ b/lib/asn1/heim_asn1.h @@ -34,7 +34,7 @@ #ifndef __HEIM_ANY_H__ #define __HEIM_ANY_H__ 1 -#include +#include int encode_heim_any(unsigned char *, size_t, const heim_any *, size_t *); int decode_heim_any(const unsigned char *, size_t, heim_any *, size_t *); diff --git a/lib/asn1/symbol.h b/lib/asn1/symbol.h index a00331617..a40547f28 100644 --- a/lib/asn1/symbol.h +++ b/lib/asn1/symbol.h @@ -36,8 +36,8 @@ #ifndef _SYMBOL_H #define _SYMBOL_H +#include #include "asn1_queue.h" -#include enum typetype { TBitString, diff --git a/lib/roken/roken.h.in b/lib/roken/roken.h.in index 210709b97..1b4ed14f2 100644 --- a/lib/roken/roken.h.in +++ b/lib/roken/roken.h.in @@ -123,6 +123,8 @@ typedef int rk_socket_t; #endif #ifdef _MSC_VER +#include + /* Declarations for Microsoft Visual C runtime on Windows */ #include diff --git a/lib/roken/strtoll.c b/lib/roken/strtoll.c index 89e1a77d3..c8c141d77 100644 --- a/lib/roken/strtoll.c +++ b/lib/roken/strtoll.c @@ -44,7 +44,6 @@ #include #include #include -#include /* * Convert a string to a long long integer. diff --git a/lib/roken/strtoull.c b/lib/roken/strtoull.c index b954a0706..ee9201f97 100644 --- a/lib/roken/strtoull.c +++ b/lib/roken/strtoull.c @@ -44,7 +44,6 @@ #include #include #include -#include /* * Convert a string to an unsigned long long integer.