summaryrefslogtreecommitdiff
path: root/src/vim.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-05-19 21:57:45 +0200
committerBram Moolenaar <Bram@vim.org>2010-05-19 21:57:45 +0200
commitfa7584cb8627e3e4226b26ef1bff42f82b8eee1e (patch)
tree46a20dea1ca10f0b74cfc12d180b25982a0cef31 /src/vim.h
parentb702c84d0d3d9874a224d81b379f9287b4a58399 (diff)
downloadvim-git-fa7584cb8627e3e4226b26ef1bff42f82b8eee1e.tar.gz
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Better autoconf check for uint32_t.
Diffstat (limited to 'src/vim.h')
-rw-r--r--src/vim.h37
1 files changed, 20 insertions, 17 deletions
diff --git a/src/vim.h b/src/vim.h
index 60eae8445..d320d3a95 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -32,10 +32,6 @@
# include "auto/config.h"
# define HAVE_PATHDEF
-/* Avoid a problem when stdint.h gets included later, autoconf defines
- * uint32_t when it is not typedef'ed. */
-# define __uint32_t_defined
-
/*
* Check if configure correctly managed to find sizeof(int). If this failed,
* it becomes zero. This is likely a problem of not being able to run the
@@ -52,6 +48,20 @@
# if defined(__CYGWIN32__) && defined(HAVE_FCHDIR)
# undef HAVE_FCHDIR
# endif
+
+/* We may need to define the uint32_t on non-Unix system, but using the same
+ * identifier causes conflicts. Therefore use UINT32_T. */
+# define UINT32_T uint32_t
+#endif
+
+#if !defined(UINT32_T)
+# if defined(uint32_t) /* this doesn't catch typedefs, unfortunately */
+# define UINT32_T uint32_t
+# else
+ /* Fall back to assuming unsigned int is 32 bit. If this is wrong then the
+ * test in blowfish.c will fail. */
+# define UINT32_T unsigned int
+# endif
#endif
/* user ID of root is usually zero, but not for everybody */
@@ -474,6 +484,12 @@ typedef unsigned long u8char_T; /* long should be 32 bits or more */
#include <assert.h>
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
#ifdef HAVE_WCTYPE_H
# include <wctype.h>
#endif
@@ -1984,12 +2000,6 @@ typedef int VimClipboard; /* This is required for the prototypes. */
#endif
-#if !defined(HAVE_CONFIG_H) && !defined(uint32_t) \
- && (defined(__CYGWIN32__) || defined(__MINGW32__))
- /* Assuming that MingW and Cygwin do not typedef uint32_t. */
-# define uint32_t unsigned int
-#endif
-
/* ISSYMLINK(mode) tests if a file is a symbolic link. */
#if (defined(S_IFMT) && defined(S_IFLNK)) || defined(S_ISLNK)
# define HAVE_ISSYMLINK
@@ -2075,13 +2085,6 @@ typedef int VimClipboard; /* This is required for the prototypes. */
# undef bool
# endif
-/* uint32_t may be defined by configure, but perh.h may indirectly include
- * stdint.h which tries to typedef uint32_t and fails. */
-# ifdef uint32_t
-# undef uint32_t
-# undef __uint32_t_defined
-# endif
-
# ifdef __BORLANDC__
/* Borland has the structure stati64 but not _stati64 */
# define _stati64 stati64