Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb02d3aa

Browse files
committed
Move substitute extern declarations to end of file, so that they are
not read until after we've read the port-specific header file. Inparticular this should make it safer to #include system headers forinet_aton; in general it seems that the port header file ought to bein a position to set definitions before we do stuff based on havinga definition or not.
1 parent3a4b3ac commitb02d3aa

File tree

1 file changed

+79
-60
lines changed

1 file changed

+79
-60
lines changed

‎src/include/pg_config.h.in

Lines changed: 79 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* or in pg_config.h afterwards. Of course, if you edit pg_config.h, then your
99
* changes will be overwritten the next time you run configure.
1010
*
11-
* $Id: pg_config.h.in,v 1.32 2002/09/05 00:43:07 tgl Exp $
11+
* $Id: pg_config.h.in,v 1.33 2002/11/07 22:08:30 tgl Exp $
1212
*/
1313

1414
#ifndefPG_CONFIG_H
@@ -332,11 +332,6 @@
332332
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
333333
#undef HAVE_FSEEKO
334334

335-
#ifndefHAVE_FSEEKO
336-
#definefseeko(a,b,c) fseek((a), (b), (c))
337-
#defineftello(a) ftell((a))
338-
#endif
339-
340335
/* Define if your cpp understands the ANSI stringizing operators in macros */
341336
#undef HAVE_STRINGIZE
342337

@@ -423,6 +418,7 @@
423418

424419
/* Set to 1 if you have gettimeofday(a) instead of gettimeofday(a,b) */
425420
#undef GETTIMEOFDAY_1ARG
421+
426422
#ifdefGETTIMEOFDAY_1ARG
427423
# definegettimeofday(a,b) gettimeofday(a)
428424
#endif
@@ -444,9 +440,6 @@
444440

445441
/* Set to 1 if you have isinf() */
446442
#undef HAVE_ISINF
447-
#ifndefHAVE_ISINF
448-
externintisinf(doublex);
449-
#endif
450443

451444
/*
452445
*These are all related to port/isinf.c
@@ -459,9 +452,6 @@ extern int isinf(double x);
459452

460453
/* Set to 1 if you have gethostname() */
461454
#undef HAVE_GETHOSTNAME
462-
#ifndefHAVE_GETHOSTNAME
463-
externintgethostname(char*name,intnamelen);
464-
#endif
465455

466456
/* Set to 1 if struct tm has a tm_zone member */
467457
#undef HAVE_TM_ZONE
@@ -479,13 +469,6 @@ extern int gethostname(char *name, int namelen);
479469
/* Set to 1 if you have inet_aton() */
480470
#undef HAVE_INET_ATON
481471

482-
#ifndefHAVE_INET_ATON
483-
# include<sys/types.h>
484-
# include<netinet/in.h>
485-
# include<arpa/inet.h>
486-
externintinet_aton(constchar*cp,structin_addr*addr);
487-
#endif
488-
489472
/* Set to 1 if you have fcvt() */
490473
#undef HAVE_FCVT
491474

@@ -501,17 +484,6 @@ extern int inet_aton(const char *cp, struct in_addr * addr);
501484
/* Set to 1 if you have sigsetjmp() */
502485
#undef HAVE_SIGSETJMP
503486

504-
/*
505-
* When there is no sigsetjmp, its functionality is provided by plain
506-
* setjmp. Incidentally, nothing provides setjmp's functionality in
507-
* that case.
508-
*/
509-
#ifndefHAVE_SIGSETJMP
510-
# definesigjmp_buf jmp_buf
511-
# definesigsetjmp(x,y)setjmp(x)
512-
# definesiglongjmp longjmp
513-
#endif
514-
515487
/* Set to 1 if you have sysconf() */
516488
#undef HAVE_SYSCONF
517489

@@ -529,9 +501,6 @@ extern int inet_aton(const char *cp, struct in_addr * addr);
529501

530502
/* Set to 1 if you have sigprocmask() */
531503
#undef HAVE_STRCASECMP
532-
#ifndefHAVE_STRCASECMP
533-
externintstrcasecmp(char*s1,char*s2);
534-
#endif
535504

536505
/* Set to 1 if you have strtol() */
537506
#undef HAVE_STRTOL
@@ -541,21 +510,12 @@ extern int strcasecmp(char *s1, char *s2);
541510

542511
/* Set to 1 if you have strdup() */
543512
#undef HAVE_STRDUP
544-
#ifndefHAVE_STRDUP
545-
externchar*strdup(charconst*);
546-
#endif
547513

548514
/* Set to 1 if you have random() */
549515
#undef HAVE_RANDOM
550-
#ifndefHAVE_RANDOM
551-
externlongrandom(void);
552-
#endif
553516

554517
/* Set to 1 if you have srandom() */
555518
#undef HAVE_SRANDOM
556-
#ifndefHAVE_SRANDOM
557-
externvoidsrandom(unsignedintseed);
558-
#endif
559519

560520
/* The random() function is expected to yield values 0 .. MAX_RANDOM_VALUE */
561521
/* Currently, all known implementations yield 0..2^31-1, so we just hardwire
@@ -575,10 +535,6 @@ extern void srandom(unsigned int seed);
575535
/* Define if the standard header unistd.h declares fdatasync() */
576536
#undef HAVE_DECL_FDATASYNC
577537

578-
#if defined(HAVE_FDATASYNC)&& !HAVE_DECL_FDATASYNC
579-
externintfdatasync(intfildes);
580-
#endif
581-
582538
/* Set to 1 if you have libz.a */
583539
#undef HAVE_LIBZ
584540

@@ -669,24 +625,12 @@ extern int fdatasync(int fildes);
669625
/* Define if you have strtoq() */
670626
#undef HAVE_STRTOQ
671627

672-
/* If strtoq() exists, rename it to the more standard strtoll() */
673-
#if defined(HAVE_LONG_LONG_INT_64)&& !defined(HAVE_STRTOLL)&& defined(HAVE_STRTOQ)
674-
# definestrtoll strtoq
675-
# defineHAVE_STRTOLL 1
676-
#endif
677-
678628
/* Define if you have strtoull() */
679629
#undef HAVE_STRTOULL
680630

681631
/* Define if you have strtouq() */
682632
#undef HAVE_STRTOUQ
683633

684-
/* If strtouq() exists, rename it to the more standard strtoull() */
685-
#if defined(HAVE_LONG_LONG_INT_64)&& !defined(HAVE_STRTOULL)&& defined(HAVE_STRTOUQ)
686-
# definestrtoull strtouq
687-
# defineHAVE_STRTOULL 1
688-
#endif
689-
690634
/* Define if you have atexit() */
691635
#undef HAVE_ATEXIT
692636

@@ -727,9 +671,17 @@ extern int fdatasync(int fildes);
727671

728672
#include"pg_config_os.h"
729673

674+
730675
/*
731-
* Provide default definitions for things that port-specific pg_config_os.h
732-
* files can set, but typically don't.
676+
*------------------------------------------------------------------------
677+
* Part 5: provide default declarations for various things that should be
678+
* provided by the system headers or the port-specific pg_config_os.h file,
679+
* but sometimes aren't.
680+
*
681+
* This must be last so that pg_config_os.h can override the defaults.
682+
* In particular, we must not pull in any system header files until we
683+
* have read pg_config_os.h (largefile support tends to break otherwise).
684+
*------------------------------------------------------------------------
733685
*/
734686

735687
#ifndefDLLIMPORT
@@ -749,5 +701,72 @@ extern int fdatasync(int fildes);
749701
#defineSIGNAL_ARGS int postgres_signal_arg
750702
#endif
751703

704+
/*
705+
* Default "extern" declarations or macro substitutes for library routines.
706+
* When necessary, these routines are provided by files in src/port/.
707+
*/
708+
#ifndefHAVE_FSEEKO
709+
#definefseeko(a,b,c) fseek((a), (b), (c))
710+
#defineftello(a) ftell((a))
711+
#endif
712+
713+
#ifndefHAVE_ISINF
714+
externintisinf(doublex);
715+
#endif
716+
717+
#ifndefHAVE_GETHOSTNAME
718+
externintgethostname(char*name,intnamelen);
719+
#endif
720+
721+
#ifndefHAVE_INET_ATON
722+
# include<sys/types.h>
723+
# include<netinet/in.h>
724+
# include<arpa/inet.h>
725+
externintinet_aton(constchar*cp,structin_addr*addr);
726+
#endif
727+
728+
/*
729+
* When there is no sigsetjmp, its functionality is provided by plain
730+
* setjmp. Incidentally, nothing provides setjmp's functionality in
731+
* that case.
732+
*/
733+
#ifndefHAVE_SIGSETJMP
734+
# definesigjmp_buf jmp_buf
735+
# definesigsetjmp(x,y)setjmp(x)
736+
# definesiglongjmp longjmp
737+
#endif
738+
739+
#ifndefHAVE_STRCASECMP
740+
externintstrcasecmp(char*s1,char*s2);
741+
#endif
742+
743+
#ifndefHAVE_STRDUP
744+
externchar*strdup(charconst*);
745+
#endif
746+
747+
#ifndefHAVE_RANDOM
748+
externlongrandom(void);
749+
#endif
750+
751+
#ifndefHAVE_SRANDOM
752+
externvoidsrandom(unsignedintseed);
753+
#endif
754+
755+
#if defined(HAVE_FDATASYNC)&& !HAVE_DECL_FDATASYNC
756+
externintfdatasync(intfildes);
757+
#endif
758+
759+
/* If strtoq() exists, rename it to the more standard strtoll() */
760+
#if defined(HAVE_LONG_LONG_INT_64)&& !defined(HAVE_STRTOLL)&& defined(HAVE_STRTOQ)
761+
# definestrtoll strtoq
762+
# defineHAVE_STRTOLL 1
763+
#endif
764+
765+
/* If strtouq() exists, rename it to the more standard strtoull() */
766+
#if defined(HAVE_LONG_LONG_INT_64)&& !defined(HAVE_STRTOULL)&& defined(HAVE_STRTOUQ)
767+
# definestrtoull strtouq
768+
# defineHAVE_STRTOULL 1
769+
#endif
770+
752771

753772
#endif/* PG_CONFIG_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp