comparison src/vim.h @ 2199:014a996ac896 vim73

Use UINT32_T in the code, define it to uint32_t or unsigned int. Better autoconf check for uint32_t.
author Bram Moolenaar <bram@vim.org>
date Wed, 19 May 2010 21:57:45 +0200
parents 898bc87c6600
children f8222d1f9a73
comparison
equal deleted inserted replaced
2198:e741fe7a0547 2199:014a996ac896
30 30
31 #ifdef HAVE_CONFIG_H /* GNU autoconf (or something else) was here */ 31 #ifdef HAVE_CONFIG_H /* GNU autoconf (or something else) was here */
32 # include "auto/config.h" 32 # include "auto/config.h"
33 # define HAVE_PATHDEF 33 # define HAVE_PATHDEF
34 34
35 /* Avoid a problem when stdint.h gets included later, autoconf defines
36 * uint32_t when it is not typedef'ed. */
37 # define __uint32_t_defined
38
39 /* 35 /*
40 * Check if configure correctly managed to find sizeof(int). If this failed, 36 * Check if configure correctly managed to find sizeof(int). If this failed,
41 * it becomes zero. This is likely a problem of not being able to run the 37 * it becomes zero. This is likely a problem of not being able to run the
42 * test program. Other items from configure may also be wrong then! 38 * test program. Other items from configure may also be wrong then!
43 */ 39 */
49 * Cygwin may have fchdir() in a newer release, but in most versions it 45 * Cygwin may have fchdir() in a newer release, but in most versions it
50 * doesn't work well and avoiding it keeps the binary backward compatible. 46 * doesn't work well and avoiding it keeps the binary backward compatible.
51 */ 47 */
52 # if defined(__CYGWIN32__) && defined(HAVE_FCHDIR) 48 # if defined(__CYGWIN32__) && defined(HAVE_FCHDIR)
53 # undef HAVE_FCHDIR 49 # undef HAVE_FCHDIR
50 # endif
51
52 /* We may need to define the uint32_t on non-Unix system, but using the same
53 * identifier causes conflicts. Therefore use UINT32_T. */
54 # define UINT32_T uint32_t
55 #endif
56
57 #if !defined(UINT32_T)
58 # if defined(uint32_t) /* this doesn't catch typedefs, unfortunately */
59 # define UINT32_T uint32_t
60 # else
61 /* Fall back to assuming unsigned int is 32 bit. If this is wrong then the
62 * test in blowfish.c will fail. */
63 # define UINT32_T unsigned int
54 # endif 64 # endif
55 #endif 65 #endif
56 66
57 /* user ID of root is usually zero, but not for everybody */ 67 /* user ID of root is usually zero, but not for everybody */
58 #ifdef __TANDEM 68 #ifdef __TANDEM
472 # endif 482 # endif
473 #endif /* NON-UNIX */ 483 #endif /* NON-UNIX */
474 484
475 #include <assert.h> 485 #include <assert.h>
476 486
487 #ifdef HAVE_STDINT_H
488 # include <stdint.h>
489 #endif
490 #ifdef HAVE_INTTYPES_H
491 # include <inttypes.h>
492 #endif
477 #ifdef HAVE_WCTYPE_H 493 #ifdef HAVE_WCTYPE_H
478 # include <wctype.h> 494 # include <wctype.h>
479 #endif 495 #endif
480 #ifdef HAVE_STDARG_H 496 #ifdef HAVE_STDARG_H
481 # include <stdarg.h> 497 # include <stdarg.h>
1982 # endif 1998 # endif
1983 # endif 1999 # endif
1984 2000
1985 #endif 2001 #endif
1986 2002
1987 #if !defined(HAVE_CONFIG_H) && !defined(uint32_t) \
1988 && (defined(__CYGWIN32__) || defined(__MINGW32__))
1989 /* Assuming that MingW and Cygwin do not typedef uint32_t. */
1990 # define uint32_t unsigned int
1991 #endif
1992
1993 /* ISSYMLINK(mode) tests if a file is a symbolic link. */ 2003 /* ISSYMLINK(mode) tests if a file is a symbolic link. */
1994 #if (defined(S_IFMT) && defined(S_IFLNK)) || defined(S_ISLNK) 2004 #if (defined(S_IFMT) && defined(S_IFLNK)) || defined(S_ISLNK)
1995 # define HAVE_ISSYMLINK 2005 # define HAVE_ISSYMLINK
1996 # if defined(S_IFMT) && defined(S_IFLNK) 2006 # if defined(S_IFMT) && defined(S_IFLNK)
1997 # define ISSYMLINK(mode) (((mode) & S_IFMT) == S_IFLNK) 2007 # define ISSYMLINK(mode) (((mode) & S_IFMT) == S_IFLNK)
2073 * and for Perl */ 2083 * and for Perl */
2074 # if defined(bool) && defined(MACOS) && !defined(FEAT_PERL) 2084 # if defined(bool) && defined(MACOS) && !defined(FEAT_PERL)
2075 # undef bool 2085 # undef bool
2076 # endif 2086 # endif
2077 2087
2078 /* uint32_t may be defined by configure, but perh.h may indirectly include
2079 * stdint.h which tries to typedef uint32_t and fails. */
2080 # ifdef uint32_t
2081 # undef uint32_t
2082 # undef __uint32_t_defined
2083 # endif
2084
2085 # ifdef __BORLANDC__ 2088 # ifdef __BORLANDC__
2086 /* Borland has the structure stati64 but not _stati64 */ 2089 /* Borland has the structure stati64 but not _stati64 */
2087 # define _stati64 stati64 2090 # define _stati64 stati64
2088 # endif 2091 # endif
2089 2092