dbTalk Databases Forums  

[BUGS] Build failure: TIMEZONE_GLOBAL undeclared

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] Build failure: TIMEZONE_GLOBAL undeclared in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Michael Fuhr
 
Posts: n/a

Default [BUGS] Build failure: TIMEZONE_GLOBAL undeclared - 09-08-2004 , 09:49 PM






A build of the latest CVS sources fails when compiling pgtz.c:

gcc -O2 -fno-strict-aliasing -g -Wall -Wmissing-prototypes -Wmissing-declarations -DFRONTEND -I../../src/include -I/usr/local/ssl/include -c -o pgtz.o pgtz.c
pgtz.c: In function `get_timezone_offset':
pgtz.c:99: error: `TIMEZONE_GLOBAL' undeclared (first use in this function)

PostgreSQL 8.0.0beta2 (CVS)
Solaris 9
gcc 3.4.1
gmake 3.80
src/timezone/pgtz.c 1.28
src/include/port.h 1.60

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Reply With Quote
  #2  
Old   
Bruce Momjian
 
Posts: n/a

Default Re: [BUGS] Build failure: TIMEZONE_GLOBAL undeclared - 09-09-2004 , 01:05 AM






Michael Fuhr wrote:
Quote:
A build of the latest CVS sources fails when compiling pgtz.c:

gcc -O2 -fno-strict-aliasing -g -Wall -Wmissing-prototypes -Wmissing-declarations -DFRONTEND -I../../src/include -I/usr/local/ssl/include -c -o pgtz.o pgtz.c
pgtz.c: In function `get_timezone_offset':
pgtz.c:99: error: `TIMEZONE_GLOBAL' undeclared (first use in this function)

PostgreSQL 8.0.0beta2 (CVS)
Solaris 9
gcc 3.4.1
gmake 3.80
src/timezone/pgtz.c 1.28
src/include/port.h 1.60
Wow, that is confusing. How could TIMEZONE_GLOBAL not be defined? Is
there some way port.h is not being included? If so I can't see it, and
it compiles here fine, which is strange. Your file version numbers
match mine though so you have all the versions I have.

--
Bruce Momjian | http://candle.pha.pa.us
pgman (AT) candle (DOT) pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
  #3  
Old   
Michael Fuhr
 
Posts: n/a

Default Re: [BUGS] Build failure: TIMEZONE_GLOBAL undeclared - 09-09-2004 , 08:44 AM



On Thu, Sep 09, 2004 at 02:03:52AM -0400, Bruce Momjian wrote:
Quote:
Michael Fuhr wrote:

gcc -O2 -fno-strict-aliasing -g -Wall -Wmissing-prototypes -Wmissing-declarations -DFRONTEND -I../../src/include -I/usr/local/ssl/include -c -o pgtz.o pgtz.c
pgtz.c: In function `get_timezone_offset':
pgtz.c:99: error: `TIMEZONE_GLOBAL' undeclared (first use in this function)

Wow, that is confusing. How could TIMEZONE_GLOBAL not be defined? Is
there some way port.h is not being included? If so I can't see it, and
it compiles here fine, which is strange.
It compiles fine on FreeBSD 4.10-STABLE with gcc 2.95.4. Running
the preprocessor on pgtz.c with "-E -dM" instead of "-c -o pgtz.o"
shows that on Solaris 9, HAVE_STRUCT_TM_TM_ZONE isn't defined and
HAVE_INT_TIMEZONE is, so the compiler hits the "return -TIMEZONE_GLOBAL"
line and fails:

#if defined(HAVE_STRUCT_TM_TM_ZONE)
return tm->tm_gmtoff;
#elif defined(HAVE_INT_TIMEZONE)
return -TIMEZONE_GLOBAL;
#else
#error No way to determine TZ? Can this happen?
#endif

On FreeBSD 4.10, HAVE_STRUCT_TM_TM_ZONE is defined, so the compiler
hits the "return tm->tm_gmtoff" line. Neither Solaris nor FreeBSD
has TIMEZONE_GLOBAL defined, presumably because port.h defines it
inside the "#ifdef WIN32" block beginning at line 169 (in port.h
version 1.60).

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)


Reply With Quote
  #4  
Old   
Bruce Momjian
 
Posts: n/a

Default Re: [BUGS] Build failure: TIMEZONE_GLOBAL undeclared - 09-09-2004 , 09:20 AM



--ELM1094739506-2484-0_
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII


OK, got it. Patch attached. That Win32 block was so big I didn't even
see it. Thanks for the detective work.

---------------------------------------------------------------------------

Michael Fuhr wrote:
Quote:
On Thu, Sep 09, 2004 at 02:03:52AM -0400, Bruce Momjian wrote:
Michael Fuhr wrote:

gcc -O2 -fno-strict-aliasing -g -Wall -Wmissing-prototypes -Wmissing-declarations -DFRONTEND -I../../src/include -I/usr/local/ssl/include -c -o pgtz.o pgtz.c
pgtz.c: In function `get_timezone_offset':
pgtz.c:99: error: `TIMEZONE_GLOBAL' undeclared (first use in this function)

Wow, that is confusing. How could TIMEZONE_GLOBAL not be defined? Is
there some way port.h is not being included? If so I can't see it, and
it compiles here fine, which is strange.

It compiles fine on FreeBSD 4.10-STABLE with gcc 2.95.4. Running
the preprocessor on pgtz.c with "-E -dM" instead of "-c -o pgtz.o"
shows that on Solaris 9, HAVE_STRUCT_TM_TM_ZONE isn't defined and
HAVE_INT_TIMEZONE is, so the compiler hits the "return -TIMEZONE_GLOBAL"
line and fails:

#if defined(HAVE_STRUCT_TM_TM_ZONE)
return tm->tm_gmtoff;
#elif defined(HAVE_INT_TIMEZONE)
return -TIMEZONE_GLOBAL;
#else
#error No way to determine TZ? Can this happen?
#endif

On FreeBSD 4.10, HAVE_STRUCT_TM_TM_ZONE is defined, so the compiler
hits the "return tm->tm_gmtoff" line. Neither Solaris nor FreeBSD
has TIMEZONE_GLOBAL defined, presumably because port.h defines it
inside the "#ifdef WIN32" block beginning at line 169 (in port.h
version 1.60).

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)

--
Bruce Momjian | http://candle.pha.pa.us
pgman (AT) candle (DOT) pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

--ELM1094739506-2484-0_
Content-Transfer-Encoding: 7bit
Content-Type: text/plain
Content-Disposition: inline; filename="/bjm/diff"

Index: src/include/port.h
================================================== =================
RCS file: /cvsroot/pgsql-server/src/include/port.h,v
retrieving revision 1.60
diff -c -c -r1.60 port.h
*** src/include/port.h 9 Sep 2004 00:59:41 -0000 1.60
--- src/include/port.h 9 Sep 2004 14:16:32 -0000
***************
*** 150,155 ****
--- 150,164 ----

extern int pclose_check(FILE *stream);

+ /* Global variable holding time zone information. */
+ #ifndef __CYGWIN__
+ #define TIMEZONE_GLOBAL timezone
+ #define TZNAME_GLOBAL tzname
+ #else
+ #define TIMEZONE_GLOBAL _timezone
+ #define TZNAME_GLOBAL _tzname
+ #endif
+
#if defined(WIN32) || defined(__CYGWIN__)
/*
* Win32 doesn't have reliable rename/unlink during concurrent access,
***************
*** 180,194 ****
#define pclose(a) _pclose(a)
#endif

- /* Global variable holding time zone information. */
- #ifndef __CYGWIN__
- #define TIMEZONE_GLOBAL timezone
- #define TZNAME_GLOBAL tzname
- #else
- #define TIMEZONE_GLOBAL _timezone
- #define TZNAME_GLOBAL _tzname
- #endif
-
extern int copydir(char *fromdir, char *todir);

/* Missing rand functions */
--- 189,194 ----

--ELM1094739506-2484-0_
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

--ELM1094739506-2484-0_--


Reply With Quote
  #5  
Old   
Michael Fuhr
 
Posts: n/a

Default Re: [BUGS] Build failure: TIMEZONE_GLOBAL undeclared - 09-10-2004 , 12:06 AM



On Thu, Sep 09, 2004 at 10:18:26AM -0400, Bruce Momjian wrote:
Quote:
OK, got it. Patch attached. That Win32 block was so big I didn't even
see it. Thanks for the detective work.
Builds fine on Solaris 9 now -- thanks.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.