summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2015-03-16 11:32:07 +0100
committerWerner Koch <wk@gnupg.org>2015-03-16 11:32:29 +0100
commitf0f60c1a04d664936bcf52e8f46705bdc63e7ad9 (patch)
tree45df52c478ae34aab2dff0032eb2d2901bf65ed0
parent97db8e1a6400d711da65eff93bb418cf55bba12e (diff)
downloadlibgcrypt-f0f60c1a04d664936bcf52e8f46705bdc63e7ad9.tar.gz
Make uintptr_t global available.
* cipher/bufhelp.h: Move include for uintptr_t to ... * src/types.h: here. Check that config.h has been included. Signed-off-by: Werner Koch <wk@gnupg.org>
-rw-r--r--cipher/bithelp.h11
-rw-r--r--cipher/bufhelp.h20
-rw-r--r--src/types.h13
3 files changed, 23 insertions, 21 deletions
diff --git a/cipher/bithelp.h b/cipher/bithelp.h
index 2220bc87..258ab2f4 100644
--- a/cipher/bithelp.h
+++ b/cipher/bithelp.h
@@ -4,7 +4,7 @@
* This file is part of Libgcrypt.
*
* Libgcrypt is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser general Public License as
+ * it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
@@ -14,11 +14,10 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef G10_BITHELP_H
-#define G10_BITHELP_H
+#ifndef GCRYPT_BITHELP_H
+#define GCRYPT_BITHELP_H
#include "types.h"
@@ -122,4 +121,4 @@ _gcry_ctz64(u64 x)
#endif /*HAVE_U64_TYPEDEF*/
-#endif /*G10_BITHELP_H*/
+#endif /*GCRYPT_BITHELP_H*/
diff --git a/cipher/bufhelp.h b/cipher/bufhelp.h
index a372acb4..c6bedc51 100644
--- a/cipher/bufhelp.h
+++ b/cipher/bufhelp.h
@@ -4,7 +4,7 @@
* This file is part of Libgcrypt.
*
* Libgcrypt is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser general Public License as
+ * it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
@@ -14,21 +14,11 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef G10_BUFHELP_H
-#define G10_BUFHELP_H
+#ifndef GCRYPT_BUFHELP_H
+#define GCRYPT_BUFHELP_H
-#include <config.h>
-
-#ifdef HAVE_STDINT_H
-# include <stdint.h> /* uintptr_t */
-#elif defined(HAVE_INTTYPES_H)
-# include <inttypes.h>
-#else
-/* In this case, uintptr_t is provided by config.h. */
-#endif
#include "bithelp.h"
@@ -409,4 +399,4 @@ static inline void buf_put_le64(void *_buf, u64 val)
#endif /*BUFHELP_FAST_UNALIGNED_ACCESS*/
-#endif /*G10_BITHELP_H*/
+#endif /*GCRYPT_BUFHELP_H*/
diff --git a/src/types.h b/src/types.h
index 561b74d1..dcdba4ff 100644
--- a/src/types.h
+++ b/src/types.h
@@ -21,6 +21,9 @@
#ifndef GCRYPT_TYPES_H
#define GCRYPT_TYPES_H
+#ifndef _GCRYPT_CONFIG_H_INCLUDED
+# error config.h must be included before types.h
+#endif
/* The AC_CHECK_SIZEOF() in configure fails for some machines.
* we provide some fallback values here */
@@ -40,6 +43,16 @@
#include <sys/types.h>
+/* Provide uintptr_t */
+#ifdef HAVE_STDINT_H
+# include <stdint.h> /* uintptr_t */
+#elif defined(HAVE_INTTYPES_H)
+# include <inttypes.h>
+#else
+/* In this case, uintptr_t is provided by config.h. */
+#endif
+
+
#ifndef HAVE_BYTE_TYPEDEF
# undef byte /* In case there is a macro with that name. */