Greetings,

  While reviewing bfba40e2c7b3909d3de13bd1b83b7e85fa8dfec2 (mmm, we like
  git diff -p), I noted that c.h is already included by both extern.h
  and ecpg.header through postgres_fe.h.  Given this and that we're
  already doing alot of similar #define's there (unlike in those other
  files), I felt c.h was a more appropriate place.  Putting it in c.h
  also means we don't have to duplicate that code.

  Patch attached.

        Thanks,

                Stephen
diff --git a/src/include/c.h b/src/include/c.h
index ea31635..d729e04 100644
*** a/src/include/c.h
--- b/src/include/c.h
*************** typedef unsigned long long int uint64;
*** 284,289 ****
--- 284,294 ----
  #error must have a working 64-bit integer datatype
  #endif
  
+ /* Do we know the C99 data type "long long"? */
+ #if defined(LLONG_MIN) || defined(LONGLONG_MIN) || defined(HAVE_LONG_LONG_INT_64)
+ #define HAVE_LONG_LONG 1
+ #endif
+ 
  /* Decide if we need to decorate 64-bit constants */
  #ifdef HAVE_LL_CONSTANTS
  #define INT64CONST(x)  ((int64) x##LL)
diff --git a/src/interfaces/ecpg/ecpglib/extern.h b/src/interfaces/ecpg/ecpglib/extern.h
index e3a7c82..7a5259f 100644
*** a/src/interfaces/ecpg/ecpglib/extern.h
--- b/src/interfaces/ecpg/ecpglib/extern.h
***************
*** 13,23 ****
  #include <limits.h>
  #endif
  
- /* Do we know the C99 data type "long long"? */
- #if defined(LLONG_MIN) || defined(LONGLONG_MIN) || defined(HAVE_LONG_LONG_INT_64)
- #define HAVE_LONG_LONG 1
- #endif
- 
  enum COMPAT_MODE
  {
  	ECPG_COMPAT_PGSQL = 0, ECPG_COMPAT_INFORMIX, ECPG_COMPAT_INFORMIX_SE
--- 13,18 ----
diff --git a/src/interfaces/ecpg/preproc/ecpg.header b/src/interfaces/ecpg/preproc/ecpg.header
index dcc87a1..6b05776 100644
*** a/src/interfaces/ecpg/preproc/ecpg.header
--- b/src/interfaces/ecpg/preproc/ecpg.header
***************
*** 7,17 ****
  #include "extern.h"
  #include <unistd.h>
  
- /* Do we know the C99 datatype "long long"? */
- #if defined(LLONG_MIN) || defined(LONGLONG_MIN) || defined(HAVE_LONG_LONG_INT_64)
- #define HAVE_LONG_LONG 1
- #endif
- 
  /* Location tracking support --- simpler than bison's default */
  #define YYLLOC_DEFAULT(Current, Rhs, N) \
  	do { \
--- 7,12 ----

Attachment: signature.asc
Description: Digital signature

Reply via email to