diff options
| author | Bruce Momjian <bruce@momjian.us> | 1998-08-23 22:25:54 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 1998-08-23 22:25:54 +0000 |
| commit | 07ae591c87ad256a5c9b081a3eb14ba5549d273f (patch) | |
| tree | b59cc37ca712b4fe248db0484e4641870dd0a18b /src/include/utils | |
| parent | 9cad9febb172b09ff8c2366a4e19469926304f0d (diff) | |
| download | postgresql-07ae591c87ad256a5c9b081a3eb14ba5549d273f.tar.gz | |
Attached is a patch that uses autoconf to determine whether there
is a working 64-bit-int type available.
In playing around with it on my machine, I found that gcc provides
perfectly fine support for "long long" arithmetic ... but sprintf()
and sscanf(), which are system-supplied, don't work :-(. So the
autoconf test program does a cursory test on them too.
If we find that a lot of systems are like this, it might be worth
the trouble to implement binary<->ASCII conversion of int64 ourselves
rather than relying on sprintf/sscanf to handle the data type.
regards, tom lane
Diffstat (limited to 'src/include/utils')
| -rw-r--r-- | src/include/utils/int8.h | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/include/utils/int8.h b/src/include/utils/int8.h index e285754d2e..dff02b7120 100644 --- a/src/include/utils/int8.h +++ b/src/include/utils/int8.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: int8.h,v 1.1 1998/07/08 14:10:30 thomas Exp $ + * $Id: int8.h,v 1.2 1998/08/23 22:25:54 momjian Exp $ * * NOTES * These data types are supported on all 64-bit architectures, and may @@ -23,29 +23,22 @@ #ifndef INT8_H #define INT8_H -#if defined(__alpha) || defined(PPC) +#ifdef HAVE_LONG_INT_64 +/* Plain "long int" fits, use it */ typedef long int int64; - #define INT64_FORMAT "%ld" - -#elif defined(__GNUC__) && defined(i386) +#else +#ifdef HAVE_LONG_LONG_INT_64 +/* We have working support for "long long int", use that */ typedef long long int int64; - #define INT64_FORMAT "%Ld" - #else +/* Won't actually work, but fall back to long int so that int8.c compiles */ typedef long int int64; - #define INT64_FORMAT "%ld" +#define INT64_IS_BUSTED #endif - - -/* -#if sizeof(int64) == 8 -#define HAVE_64BIT_INTS 1 #endif -*/ - extern int64 *int8in(char *str); extern char *int8out(int64 * val); |
