diff options
author | Michael Meskes <meskes@postgresql.org> | 2010-05-25 17:28:20 +0000 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2010-05-25 17:28:20 +0000 |
commit | 29259531c7b48384dba863124aff79e05980b329 (patch) | |
tree | 290b34b78076d9d4ca463f9e99393cd162dedab9 /src | |
parent | 9b6dba119349475f12d2a909ca265770156c4667 (diff) | |
download | postgresql-29259531c7b48384dba863124aff79e05980b329.tar.gz postgresql-29259531c7b48384dba863124aff79e05980b329.zip |
Replace self written 'long long int' configure test by standard 'AC_TYPE_LONG_LONG_INT' macro call.
Diffstat (limited to 'src')
-rw-r--r-- | src/include/pg_config.h.in | 4 | ||||
-rw-r--r-- | src/interfaces/ecpg/ecpglib/data.c | 22 | ||||
-rw-r--r-- | src/interfaces/ecpg/ecpglib/descriptor.c | 10 | ||||
-rw-r--r-- | src/interfaces/ecpg/ecpglib/execute.c | 18 | ||||
-rw-r--r-- | src/interfaces/ecpg/ecpglib/misc.c | 18 | ||||
-rw-r--r-- | src/interfaces/ecpg/include/ecpg_config.h.in | 6 | ||||
-rw-r--r-- | src/interfaces/ecpg/preproc/ecpg.trailer | 10 |
7 files changed, 44 insertions, 44 deletions
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in index 0d564b87de7..fd169b682fb 100644 --- a/src/include/pg_config.h.in +++ b/src/include/pg_config.h.in @@ -330,8 +330,8 @@ /* Define to 1 if `long int' works and is 64 bits. */ #undef HAVE_LONG_INT_64 -/* Define to 1 if the C compiler does understand long long type. */ -#undef HAVE_LONG_LONG +/* Define to 1 if the system has the type `long long int'. */ +#undef HAVE_LONG_LONG_INT /* Define to 1 if `long long int' works and is 64 bits. */ #undef HAVE_LONG_LONG_INT_64 diff --git a/src/interfaces/ecpg/ecpglib/data.c b/src/interfaces/ecpg/ecpglib/data.c index 6088c66aa52..79af7b1ebb0 100644 --- a/src/interfaces/ecpg/ecpglib/data.c +++ b/src/interfaces/ecpg/ecpglib/data.c @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.52 2010/05/20 22:10:45 meskes Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.53 2010/05/25 17:28:20 meskes Exp $ */ #define POSTGRES_ECPG_INTERNAL #include "postgres_fe.h" @@ -177,12 +177,12 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno, case ECPGt_unsigned_long: *((long *) (ind + ind_offset * act_tuple)) = value_for_indicator; break; -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT case ECPGt_long_long: case ECPGt_unsigned_long_long: *((long long int *) (ind + ind_offset * act_tuple)) = value_for_indicator; break; -#endif /* HAVE_LONG_LONG */ +#endif /* HAVE_LONG_LONG_INT */ case ECPGt_NO_INDICATOR: if (value_for_indicator == -1) { @@ -265,12 +265,12 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno, case ECPGt_unsigned_long: *((long *) (ind + ind_offset * act_tuple)) = size; break; -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT case ECPGt_long_long: case ECPGt_unsigned_long_long: *((long long int *) (ind + ind_offset * act_tuple)) = size; break; -#endif /* HAVE_LONG_LONG */ +#endif /* HAVE_LONG_LONG_INT */ default: break; } @@ -350,7 +350,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno, } break; -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT #ifdef HAVE_STRTOLL case ECPGt_long_long: *((long long int *) (var + offset * act_tuple)) = strtoll(pval, &scan_length, 10); @@ -376,7 +376,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno, break; #endif /* HAVE_STRTOULL */ -#endif /* HAVE_LONG_LONG */ +#endif /* HAVE_LONG_LONG_INT */ case ECPGt_float: case ECPGt_double: @@ -489,12 +489,12 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno, case ECPGt_unsigned_long: *((long *) (ind + ind_offset * act_tuple)) = size; break; -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT case ECPGt_long_long: case ECPGt_unsigned_long_long: *((long long int *) (ind + ind_offset * act_tuple)) = size; break; -#endif /* HAVE_LONG_LONG */ +#endif /* HAVE_LONG_LONG_INT */ default: break; } @@ -534,12 +534,12 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno, case ECPGt_unsigned_long: *((long *) (ind + offset * act_tuple)) = variable->len; break; -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT case ECPGt_long_long: case ECPGt_unsigned_long_long: *((long long int *) (ind + ind_offset * act_tuple)) = variable->len; break; -#endif /* HAVE_LONG_LONG */ +#endif /* HAVE_LONG_LONG_INT */ default: break; } diff --git a/src/interfaces/ecpg/ecpglib/descriptor.c b/src/interfaces/ecpg/ecpglib/descriptor.c index b2edc2850b3..cebc8b67fa0 100644 --- a/src/interfaces/ecpg/ecpglib/descriptor.c +++ b/src/interfaces/ecpg/ecpglib/descriptor.c @@ -1,6 +1,6 @@ /* dynamic SQL support routines * - * $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/descriptor.c,v 1.37 2010/05/20 22:10:45 meskes Exp $ + * $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/descriptor.c,v 1.38 2010/05/25 17:28:20 meskes Exp $ */ #define POSTGRES_ECPG_INTERNAL @@ -127,14 +127,14 @@ get_int_item(int lineno, void *var, enum ECPGttype vartype, int value) case ECPGt_unsigned_long: *(unsigned long *) var = (unsigned long) value; break; -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT case ECPGt_long_long: *(long long int *) var = (long long int) value; break; case ECPGt_unsigned_long_long: *(unsigned long long int *) var = (unsigned long long int) value; break; -#endif /* HAVE_LONG_LONG */ +#endif /* HAVE_LONG_LONG_INT */ case ECPGt_float: *(float *) var = (float) value; break; @@ -172,14 +172,14 @@ set_int_item(int lineno, int *target, const void *var, enum ECPGttype vartype) case ECPGt_unsigned_long: *target = *(unsigned long *) var; break; -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT case ECPGt_long_long: *target = *(long long int *) var; break; case ECPGt_unsigned_long_long: *target = *(unsigned long long int *) var; break; -#endif /* HAVE_LONG_LONG */ +#endif /* HAVE_LONG_LONG_INT */ case ECPGt_float: *target = *(float *) var; break; diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c index 60b7c75f0ec..868bc699b0b 100644 --- a/src/interfaces/ecpg/ecpglib/execute.c +++ b/src/interfaces/ecpg/ecpglib/execute.c @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.96 2010/05/20 22:10:45 meskes Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.97 2010/05/25 17:28:20 meskes Exp $ */ /* * The aim is to get a simpler inteface to the database routines. @@ -541,13 +541,13 @@ ecpg_store_input(const int lineno, const bool force_indicator, const struct vari if (*(long *) var->ind_value < 0L) *tobeinserted_p = NULL; break; -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT case ECPGt_long_long: case ECPGt_unsigned_long_long: if (*(long long int *) var->ind_value < (long long) 0) *tobeinserted_p = NULL; break; -#endif /* HAVE_LONG_LONG */ +#endif /* HAVE_LONG_LONG_INT */ case ECPGt_NO_INDICATOR: if (force_indicator == false) { @@ -679,7 +679,7 @@ ecpg_store_input(const int lineno, const bool force_indicator, const struct vari *tobeinserted_p = mallocedval; break; -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT case ECPGt_long_long: if (!(mallocedval = ecpg_alloc(asize * 30, lineno))) return false; @@ -689,12 +689,12 @@ ecpg_store_input(const int lineno, const bool force_indicator, const struct vari strcpy(mallocedval, "array ["); for (element = 0; element < asize; element++) - sprintf(mallocedval + strlen(mallocedval), "%lld,", ((long long *) var->value)[element]); + sprintf(mallocedval + strlen(mallocedval), "%lld,", ((long long int *) var->value)[element]); strcpy(mallocedval + strlen(mallocedval) - 1, "]"); } else - sprintf(mallocedval, "%lld", *((long long *) var->value)); + sprintf(mallocedval, "%lld", *((long long int *) var->value)); *tobeinserted_p = mallocedval; break; @@ -708,16 +708,16 @@ ecpg_store_input(const int lineno, const bool force_indicator, const struct vari strcpy(mallocedval, "array ["); for (element = 0; element < asize; element++) - sprintf(mallocedval + strlen(mallocedval), "%llu,", ((unsigned long long *) var->value)[element]); + sprintf(mallocedval + strlen(mallocedval), "%llu,", ((unsigned long long int*) var->value)[element]); strcpy(mallocedval + strlen(mallocedval) - 1, "]"); } else - sprintf(mallocedval, "%llu", *((unsigned long long *) var->value)); + sprintf(mallocedval, "%llu", *((unsigned long long int *) var->value)); *tobeinserted_p = mallocedval; break; -#endif /* HAVE_LONG_LONG */ +#endif /* HAVE_LONG_LONG_INT */ case ECPGt_float: if (!(mallocedval = ecpg_alloc(asize * 25, lineno))) return false; diff --git a/src/interfaces/ecpg/ecpglib/misc.c b/src/interfaces/ecpg/ecpglib/misc.c index 92cbad9a188..6095c04b627 100644 --- a/src/interfaces/ecpg/ecpglib/misc.c +++ b/src/interfaces/ecpg/ecpglib/misc.c @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.57 2010/05/20 22:10:46 meskes Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.58 2010/05/25 17:28:20 meskes Exp $ */ #define POSTGRES_ECPG_INTERNAL #include "postgres_fe.h" @@ -17,15 +17,15 @@ #include "pgtypes_interval.h" #include "pg_config_paths.h" -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT #ifndef LONG_LONG_MIN #ifdef LLONG_MIN #define LONG_LONG_MIN LLONG_MIN #else #define LONG_LONG_MIN LONGLONG_MIN -#endif -#endif -#endif +#endif /* LLONG_MIN */ +#endif /* LONG_LONG_MIN */ +#endif /* HAVE_LONG_LONG_INT */ bool ecpg_internal_regression_mode = false; @@ -327,12 +327,12 @@ ECPGset_noind_null(enum ECPGttype type, void *ptr) case ECPGt_date: *((long *) ptr) = LONG_MIN; break; -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT case ECPGt_long_long: case ECPGt_unsigned_long_long: *((long long *) ptr) = LONG_LONG_MIN; break; -#endif /* HAVE_LONG_LONG */ +#endif /* HAVE_LONG_LONG_INT */ case ECPGt_float: memset((char *) ptr, 0xff, sizeof(float)); break; @@ -399,13 +399,13 @@ ECPGis_noind_null(enum ECPGttype type, void *ptr) if (*((long *) ptr) == LONG_MIN) return true; break; -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT case ECPGt_long_long: case ECPGt_unsigned_long_long: if (*((long long *) ptr) == LONG_LONG_MIN) return true; break; -#endif /* HAVE_LONG_LONG */ +#endif /* HAVE_LONG_LONG_INT */ case ECPGt_float: return (_check(ptr, sizeof(float))); break; diff --git a/src/interfaces/ecpg/include/ecpg_config.h.in b/src/interfaces/ecpg/include/ecpg_config.h.in index 5ee42c8ab7d..72a34f4be0e 100644 --- a/src/interfaces/ecpg/include/ecpg_config.h.in +++ b/src/interfaces/ecpg/include/ecpg_config.h.in @@ -4,6 +4,9 @@ /* Define to 1 if `long int' works and is 64 bits. */ #undef HAVE_LONG_INT_64 +/* Define to 1 if the system has the type `long long int'. */ +#undef HAVE_LONG_LONG_INT + /* Define to 1 if `long long int' works and is 64 bits. */ #undef HAVE_LONG_LONG_INT_64 @@ -15,6 +18,3 @@ * (--enable-thread-safety) */ #undef ENABLE_THREAD_SAFETY -/* Define to 1 if the C compiler does understand long long type. */ -#undef HAVE_LONG_LONG - diff --git a/src/interfaces/ecpg/preproc/ecpg.trailer b/src/interfaces/ecpg/preproc/ecpg.trailer index 1d854d4bbc0..59fc26c0ddc 100644 --- a/src/interfaces/ecpg/preproc/ecpg.trailer +++ b/src/interfaces/ecpg/preproc/ecpg.trailer @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.trailer,v 1.25 2010/05/20 22:10:46 meskes Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.trailer,v 1.26 2010/05/25 17:28:20 meskes Exp $ */ statements: /*EMPTY*/ | statements statement @@ -781,7 +781,7 @@ unsigned_type: SQL_UNSIGNED SQL_SHORT { $$ = ECPGt_unsigned_short; } | SQL_UNSIGNED SQL_LONG INT_P { $$ = ECPGt_unsigned_long; } | SQL_UNSIGNED SQL_LONG SQL_LONG { -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT $$ = ECPGt_unsigned_long_long; #else $$ = ECPGt_unsigned_long; @@ -789,7 +789,7 @@ unsigned_type: SQL_UNSIGNED SQL_SHORT { $$ = ECPGt_unsigned_short; } } | SQL_UNSIGNED SQL_LONG SQL_LONG INT_P { -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT $$ = ECPGt_unsigned_long_long; #else $$ = ECPGt_unsigned_long; @@ -805,7 +805,7 @@ signed_type: SQL_SHORT { $$ = ECPGt_short; } | SQL_LONG INT_P { $$ = ECPGt_long; } | SQL_LONG SQL_LONG { -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT $$ = ECPGt_long_long; #else $$ = ECPGt_long; @@ -813,7 +813,7 @@ signed_type: SQL_SHORT { $$ = ECPGt_short; } } | SQL_LONG SQL_LONG INT_P { -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT $$ = ECPGt_long_long; #else $$ = ECPGt_long; |