diff options
| author | Peter Eisentraut | 2019-11-07 12:30:04 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2019-11-07 12:30:04 +0000 |
| commit | effa40281bb1f6c71e81c980f86852ab3be603c3 (patch) | |
| tree | c5897e93b6abacc7dbc1df4b5acdf11654e2dab1 /src/interfaces/ecpg/ecpglib | |
| parent | 581a55889ba7f76dd87a270e37e5137f684bfdb7 (diff) | |
Remove HAVE_LONG_LONG_INT
The presence of long long int is now implied in the requirement for
C99 and the configure check for the same.
We keep the define hard-coded in ecpg_config.h for backward
compatibility with ecpg-using user code.
Discussion: https://www.postgresql.org/message-id/flat/5cdd6a2b-b2c7-c6f6-344c-a406d5c1a254%402ndquadrant.com
Diffstat (limited to 'src/interfaces/ecpg/ecpglib')
| -rw-r--r-- | src/interfaces/ecpg/ecpglib/data.c | 14 | ||||
| -rw-r--r-- | src/interfaces/ecpg/ecpglib/descriptor.c | 4 | ||||
| -rw-r--r-- | src/interfaces/ecpg/ecpglib/execute.c | 6 | ||||
| -rw-r--r-- | src/interfaces/ecpg/ecpglib/misc.c | 6 |
4 files changed, 2 insertions, 28 deletions
diff --git a/src/interfaces/ecpg/ecpglib/data.c b/src/interfaces/ecpg/ecpglib/data.c index 7d2a78a60d8..d3db5094cfa 100644 --- a/src/interfaces/ecpg/ecpglib/data.c +++ b/src/interfaces/ecpg/ecpglib/data.c @@ -267,12 +267,10 @@ 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_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_INT */ case ECPGt_NO_INDICATOR: if (value_for_indicator == -1) { @@ -355,12 +353,10 @@ 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_INT case ECPGt_long_long: case ECPGt_unsigned_long_long: *((long long int *) (ind + ind_offset * act_tuple)) = size; break; -#endif /* HAVE_LONG_LONG_INT */ default: break; } @@ -442,7 +438,6 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno, } break; -#ifdef HAVE_LONG_LONG_INT #ifdef HAVE_STRTOLL case ECPGt_long_long: *((long long int *) (var + offset * act_tuple)) = strtoll(pval, &scan_length, 10); @@ -467,7 +462,6 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno, break; #endif /* HAVE_STRTOULL */ -#endif /* HAVE_LONG_LONG_INT */ case ECPGt_float: case ECPGt_double: @@ -559,12 +553,10 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno, case ECPGt_unsigned_long: *((long *) (ind + ind_offset * act_tuple)) = rcv_size; break; -#ifdef HAVE_LONG_LONG_INT case ECPGt_long_long: case ECPGt_unsigned_long_long: *((long long int *) (ind + ind_offset * act_tuple)) = rcv_size; break; -#endif /* HAVE_LONG_LONG_INT */ default: break; } @@ -623,12 +615,10 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno, case ECPGt_unsigned_long: *((long *) (ind + ind_offset * act_tuple)) = -1; break; -#ifdef HAVE_LONG_LONG_INT case ECPGt_long_long: case ECPGt_unsigned_long_long: *((long long int *) (ind + ind_offset * act_tuple)) = -1; break; -#endif /* HAVE_LONG_LONG_INT */ default: break; } @@ -678,12 +668,10 @@ 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_INT case ECPGt_long_long: case ECPGt_unsigned_long_long: *((long long int *) (ind + ind_offset * act_tuple)) = size; break; -#endif /* HAVE_LONG_LONG_INT */ default: break; } @@ -723,12 +711,10 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno, case ECPGt_unsigned_long: *((long *) (ind + ind_offset * act_tuple)) = variable->len; break; -#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_INT */ default: break; } diff --git a/src/interfaces/ecpg/ecpglib/descriptor.c b/src/interfaces/ecpg/ecpglib/descriptor.c index ead8778ca83..7bd0534ef70 100644 --- a/src/interfaces/ecpg/ecpglib/descriptor.c +++ b/src/interfaces/ecpg/ecpglib/descriptor.c @@ -134,14 +134,12 @@ 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_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_INT */ case ECPGt_float: *(float *) var = (float) value; break; @@ -179,14 +177,12 @@ set_int_item(int lineno, int *target, const void *var, enum ECPGttype vartype) case ECPGt_unsigned_long: *target = *(const unsigned long *) var; break; -#ifdef HAVE_LONG_LONG_INT case ECPGt_long_long: *target = *(const long long int *) var; break; case ECPGt_unsigned_long_long: *target = *(const unsigned long long int *) var; break; -#endif /* HAVE_LONG_LONG_INT */ case ECPGt_float: *target = *(const float *) var; break; diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c index 23cc86941cf..e261cf91671 100644 --- a/src/interfaces/ecpg/ecpglib/execute.c +++ b/src/interfaces/ecpg/ecpglib/execute.c @@ -543,13 +543,11 @@ 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_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_INT */ case ECPGt_NO_INDICATOR: if (force_indicator == false) { @@ -681,7 +679,7 @@ ecpg_store_input(const int lineno, const bool force_indicator, const struct vari *tobeinserted_p = mallocedval; break; -#ifdef HAVE_LONG_LONG_INT + case ECPGt_long_long: if (!(mallocedval = ecpg_alloc(asize * 30, lineno))) return false; @@ -719,7 +717,7 @@ ecpg_store_input(const int lineno, const bool force_indicator, const struct vari *tobeinserted_p = mallocedval; break; -#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 647da14fce4..c4b2183b5dd 100644 --- a/src/interfaces/ecpg/ecpglib/misc.c +++ b/src/interfaces/ecpg/ecpglib/misc.c @@ -18,7 +18,6 @@ #include "pg_config_paths.h" #include "sqlca.h" -#ifdef HAVE_LONG_LONG_INT #ifndef LONG_LONG_MIN #ifdef LLONG_MIN #define LONG_LONG_MIN LLONG_MIN @@ -26,7 +25,6 @@ #define LONG_LONG_MIN LONGLONG_MIN #endif /* LLONG_MIN */ #endif /* LONG_LONG_MIN */ -#endif /* HAVE_LONG_LONG_INT */ bool ecpg_internal_regression_mode = false; @@ -340,12 +338,10 @@ ECPGset_noind_null(enum ECPGttype type, void *ptr) case ECPGt_date: *((long *) ptr) = LONG_MIN; break; -#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_INT */ case ECPGt_float: memset((char *) ptr, 0xff, sizeof(float)); break; @@ -415,13 +411,11 @@ ECPGis_noind_null(enum ECPGttype type, const void *ptr) if (*((const long *) ptr) == LONG_MIN) return true; break; -#ifdef HAVE_LONG_LONG_INT case ECPGt_long_long: case ECPGt_unsigned_long_long: if (*((const long long *) ptr) == LONG_LONG_MIN) return true; break; -#endif /* HAVE_LONG_LONG_INT */ case ECPGt_float: return _check(ptr, sizeof(float)); break; |
