[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

[PATCH: Configure] Fix prototype detection for C++



A few tests are currently failing when building a threaded perl
with g++, which can also be seen in some smoke reports, e.g.

>    34562     Configuration (common) -Dcc=g++
> ----------- ---------------------------------------------------------
> O O M -     
> O O M -     -Duse64bitint
> M - F F     -Duselongdouble
> F F M -     -Dusemorebits
> F F F F     -Duseithreads
> F F M -     -Duseithreads -Duse64bitint
> F F M -     -Duseithreads -Duselongdouble
> F F M -     -Duseithreads -Dusemorebits
> | | | +----- PERLIO = perlio -DDEBUGGING  
> | | +------- PERLIO = stdio  -DDEBUGGING  
> | +--------- PERLIO = perlio  
> +----------- PERLIO = stdio

The tests in question are:

>     ../t/op/mkdir.t.............................................FAILED
>         3, 7
>     ../lib/constant.t...........................................FAILED
>         33
>     ../t/op/time.t..............................................FAILED
>         5

The reason for the mkdir.t and constant.t failures is that the
prototypes for the reentrant C library calls are not determined
correctly, in particular the prototype for strerror_r(), which
causes $! to never stringify.

The reason behind the time.t failure is that $d_localtime_r_needs_tzset
is not determined correctly. It needs to be defined, but isn't,
as the test code in Configure doesn't compile with g++.

The attached patch against Configure attempts to solve both
problems (and at least on my box works perfectly fine).

The reason for the misdetected prototypes is that the external
declarations in the test code use C++ linkage, while the prototypes
in the included headers use C linkage. So there's not much for
the compiler to complain about, as the external declaration will
never interfere with the prototype.

The patch introduces a new variable $externC that is set to
'extern' for a C compiler and to 'extern "C"' for a C++ compiler,
and uses this variable instead of the 'extern' in all protochk
invocations. Probably this will also fix failures in other
configurations or on other platforms.

The problem with the $d_localtime_r_needs_tzset code not compiling
is that putenv()'s prototype is in stdlib.h, which isn't included.
As this is a standard header, it's safe to include, which is also
what the patch does.

Marcus

-- 
Torque is cheap.
--- Configure.orig	2008-10-26 12:29:57.000000000 +0100
+++ Configure	2008-10-26 13:22:46.000000000 +0100
@@ -10167,6 +10167,11 @@
 *)              echo "No, it doesn't." ;;
 esac
 
+case "$d_cplusplus" in
+	"$define")	externC="extern \"C\"";;
+	*)		externC="extern";;
+esac
+
 : see if asctime_r exists
 set asctime_r d_asctime_r
 eval $inlibc
@@ -10183,19 +10188,19 @@
 	define)
 	case "$asctime_r_proto" in
 	''|0) try='char* asctime_r(const struct tm*, char*);'
-	./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
+	./protochk "$externC $try" $hdrs && asctime_r_proto=B_SB ;;
 	esac
 	case "$asctime_r_proto" in
 	''|0) try='char* asctime_r(const struct tm*, char*, int);'
-	./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
+	./protochk "$externC $try" $hdrs && asctime_r_proto=B_SBI ;;
 	esac
 	case "$asctime_r_proto" in
 	''|0) try='int asctime_r(const struct tm*, char*);'
-	./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
+	./protochk "$externC $try" $hdrs && asctime_r_proto=I_SB ;;
 	esac
 	case "$asctime_r_proto" in
 	''|0) try='int asctime_r(const struct tm*, char*, int);'
-	./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
+	./protochk "$externC $try" $hdrs && asctime_r_proto=I_SBI ;;
 	esac
 	case "$asctime_r_proto" in
 	''|0)	d_asctime_r=undef
@@ -11328,11 +11333,11 @@
 	define)
 	case "$crypt_r_proto" in
 	''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
-	./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
+	./protochk "$externC $try" $hdrs && crypt_r_proto=B_CCS ;;
 	esac
 	case "$crypt_r_proto" in
 	''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
-	./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
+	./protochk "$externC $try" $hdrs && crypt_r_proto=B_CCD ;;
 	esac
 	case "$crypt_r_proto" in
 	''|0)	d_crypt_r=undef
@@ -11389,7 +11394,7 @@
 	define)
 	case "$ctermid_r_proto" in
 	''|0) try='char* ctermid_r(char*);'
-	./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
+	./protochk "$externC $try" $hdrs && ctermid_r_proto=B_B ;;
 	esac
 	case "$ctermid_r_proto" in
 	''|0)	d_ctermid_r=undef
@@ -11430,19 +11435,19 @@
 	define)
 	case "$ctime_r_proto" in
 	''|0) try='char* ctime_r(const time_t*, char*);'
-	./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
+	./protochk "$externC $try" $hdrs && ctime_r_proto=B_SB ;;
 	esac
 	case "$ctime_r_proto" in
 	''|0) try='char* ctime_r(const time_t*, char*, int);'
-	./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
+	./protochk "$externC $try" $hdrs && ctime_r_proto=B_SBI ;;
 	esac
 	case "$ctime_r_proto" in
 	''|0) try='int ctime_r(const time_t*, char*);'
-	./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
+	./protochk "$externC $try" $hdrs && ctime_r_proto=I_SB ;;
 	esac
 	case "$ctime_r_proto" in
 	''|0) try='int ctime_r(const time_t*, char*, int);'
-	./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
+	./protochk "$externC $try" $hdrs && ctime_r_proto=I_SBI ;;
 	esac
 	case "$ctime_r_proto" in
 	''|0)	d_ctime_r=undef
@@ -11848,7 +11853,7 @@
 	define)
 	case "$drand48_r_proto" in
 	''|0) try='int drand48_r(struct drand48_data*, double*);'
-	./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
+	./protochk "$externC $try" $hdrs && drand48_r_proto=I_ST ;;
 	esac
 	case "$drand48_r_proto" in
 	''|0)	d_drand48_r=undef
@@ -11931,11 +11936,11 @@
 	define)
 	case "$endgrent_r_proto" in
 	''|0) try='int endgrent_r(FILE**);'
-	./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
+	./protochk "$externC $try" $hdrs && endgrent_r_proto=I_H ;;
 	esac
 	case "$endgrent_r_proto" in
 	''|0) try='void endgrent_r(FILE**);'
-	./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
+	./protochk "$externC $try" $hdrs && endgrent_r_proto=V_H ;;
 	esac
 	case "$endgrent_r_proto" in
 	''|0)	d_endgrent_r=undef
@@ -11984,11 +11989,11 @@
 	define)
 	case "$endhostent_r_proto" in
 	''|0) try='int endhostent_r(struct hostent_data*);'
-	./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
+	./protochk "$externC $try" $hdrs && endhostent_r_proto=I_D ;;
 	esac
 	case "$endhostent_r_proto" in
 	''|0) try='void endhostent_r(struct hostent_data*);'
-	./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
+	./protochk "$externC $try" $hdrs && endhostent_r_proto=V_D ;;
 	esac
 	case "$endhostent_r_proto" in
 	''|0)	d_endhostent_r=undef
@@ -12033,11 +12038,11 @@
 	define)
 	case "$endnetent_r_proto" in
 	''|0) try='int endnetent_r(struct netent_data*);'
-	./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
+	./protochk "$externC $try" $hdrs && endnetent_r_proto=I_D ;;
 	esac
 	case "$endnetent_r_proto" in
 	''|0) try='void endnetent_r(struct netent_data*);'
-	./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
+	./protochk "$externC $try" $hdrs && endnetent_r_proto=V_D ;;
 	esac
 	case "$endnetent_r_proto" in
 	''|0)	d_endnetent_r=undef
@@ -12082,11 +12087,11 @@
 	define)
 	case "$endprotoent_r_proto" in
 	''|0) try='int endprotoent_r(struct protoent_data*);'
-	./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
+	./protochk "$externC $try" $hdrs && endprotoent_r_proto=I_D ;;
 	esac
 	case "$endprotoent_r_proto" in
 	''|0) try='void endprotoent_r(struct protoent_data*);'
-	./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
+	./protochk "$externC $try" $hdrs && endprotoent_r_proto=V_D ;;
 	esac
 	case "$endprotoent_r_proto" in
 	''|0)	d_endprotoent_r=undef
@@ -12219,11 +12224,11 @@
 	define)
 	case "$endpwent_r_proto" in
 	''|0) try='int endpwent_r(FILE**);'
-	./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
+	./protochk "$externC $try" $hdrs && endpwent_r_proto=I_H ;;
 	esac
 	case "$endpwent_r_proto" in
 	''|0) try='void endpwent_r(FILE**);'
-	./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
+	./protochk "$externC $try" $hdrs && endpwent_r_proto=V_H ;;
 	esac
 	case "$endpwent_r_proto" in
 	''|0)	d_endpwent_r=undef
@@ -12268,11 +12273,11 @@
 	define)
 	case "$endservent_r_proto" in
 	''|0) try='int endservent_r(struct servent_data*);'
-	./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
+	./protochk "$externC $try" $hdrs && endservent_r_proto=I_D ;;
 	esac
 	case "$endservent_r_proto" in
 	''|0) try='void endservent_r(struct servent_data*);'
-	./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
+	./protochk "$externC $try" $hdrs && endservent_r_proto=V_D ;;
 	esac
 	case "$endservent_r_proto" in
 	''|0)	d_endservent_r=undef
@@ -13306,27 +13311,27 @@
 	define)
 	case "$getgrent_r_proto" in
 	''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
-	./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
+	./protochk "$externC $try" $hdrs && getgrent_r_proto=I_SBWR ;;
 	esac
 	case "$getgrent_r_proto" in
 	''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
-	./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
+	./protochk "$externC $try" $hdrs && getgrent_r_proto=I_SBIR ;;
 	esac
 	case "$getgrent_r_proto" in
 	''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
-	./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
+	./protochk "$externC $try" $hdrs && getgrent_r_proto=S_SBW ;;
 	esac
 	case "$getgrent_r_proto" in
 	''|0) try='struct group* getgrent_r(struct group*, char*, int);'
-	./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
+	./protochk "$externC $try" $hdrs && getgrent_r_proto=S_SBI ;;
 	esac
 	case "$getgrent_r_proto" in
 	''|0) try='int getgrent_r(struct group*, char*, int);'
-	./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
+	./protochk "$externC $try" $hdrs && getgrent_r_proto=I_SBI ;;
 	esac
 	case "$getgrent_r_proto" in
 	''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
-	./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
+	./protochk "$externC $try" $hdrs && getgrent_r_proto=I_SBIH ;;
 	esac
 	case "$getgrent_r_proto" in
 	''|0)	d_getgrent_r=undef
@@ -13367,19 +13372,19 @@
 	define)
 	case "$getgrgid_r_proto" in
 	''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
-	./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
+	./protochk "$externC $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
 	esac
 	case "$getgrgid_r_proto" in
 	''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
-	./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
+	./protochk "$externC $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
 	esac
 	case "$getgrgid_r_proto" in
 	''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
-	./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
+	./protochk "$externC $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
 	esac
 	case "$getgrgid_r_proto" in
 	''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
-	./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
+	./protochk "$externC $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
 	esac
 	case "$getgrgid_r_proto" in
 	''|0)	d_getgrgid_r=undef
@@ -13420,23 +13425,23 @@
 	define)
 	case "$getgrnam_r_proto" in
 	''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
-	./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
+	./protochk "$externC $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
 	esac
 	case "$getgrnam_r_proto" in
 	''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
-	./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
+	./protochk "$externC $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
 	esac
 	case "$getgrnam_r_proto" in
 	''|0) try='struct group* getgrnam_r(const char*, char*, int);'
-	./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
+	./protochk "$externC $try" $hdrs && getgrnam_r_proto=S_CBI ;;
 	esac
 	case "$getgrnam_r_proto" in
 	''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
-	./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
+	./protochk "$externC $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
 	esac
 	case "$getgrnam_r_proto" in
 	''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
-	./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
+	./protochk "$externC $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
 	esac
 	case "$getgrnam_r_proto" in
 	''|0)	d_getgrnam_r=undef
@@ -13574,47 +13579,47 @@
 	define)
 	case "$gethostbyaddr_r_proto" in
 	''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
-	./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
+	./protochk "$externC $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
 	esac
 	case "$gethostbyaddr_r_proto" in
 	''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
-	./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
+	./protochk "$externC $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
 	esac
 	case "$gethostbyaddr_r_proto" in
 	''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
-	./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
+	./protochk "$externC $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
 	esac
 	case "$gethostbyaddr_r_proto" in
 	''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
-	./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
+	./protochk "$externC $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
 	esac
 	case "$gethostbyaddr_r_proto" in
 	''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
-	./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
+	./protochk "$externC $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
 	esac
 	case "$gethostbyaddr_r_proto" in
 	''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
-	./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
+	./protochk "$externC $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
 	esac
 	case "$gethostbyaddr_r_proto" in
 	''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
-	./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
+	./protochk "$externC $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
 	esac
 	case "$gethostbyaddr_r_proto" in
 	''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
-	./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
+	./protochk "$externC $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
 	esac
 	case "$gethostbyaddr_r_proto" in
 	''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
-	./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
+	./protochk "$externC $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
 	esac
 	case "$gethostbyaddr_r_proto" in
 	''|0) try='int gethostbyaddr_r(const char*, int, int);'
-	./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
+	./protochk "$externC $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
 	esac
 	case "$gethostbyaddr_r_proto" in
 	''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
-	./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
+	./protochk "$externC $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
 	esac
 	case "$gethostbyaddr_r_proto" in
 	''|0)	d_gethostbyaddr_r=undef
@@ -13655,15 +13660,15 @@
 	define)
 	case "$gethostbyname_r_proto" in
 	''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
-	./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
+	./protochk "$externC $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
 	esac
 	case "$gethostbyname_r_proto" in
 	''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
-	./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
+	./protochk "$externC $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
 	esac
 	case "$gethostbyname_r_proto" in
 	''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
-	./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
+	./protochk "$externC $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
 	esac
 	case "$gethostbyname_r_proto" in
 	''|0)	d_gethostbyname_r=undef
@@ -13704,27 +13709,27 @@
 	define)
 	case "$gethostent_r_proto" in
 	''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
-	./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
+	./protochk "$externC $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
 	esac
 	case "$gethostent_r_proto" in
 	''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
-	./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
+	./protochk "$externC $try" $hdrs && gethostent_r_proto=I_SBIE ;;
 	esac
 	case "$gethostent_r_proto" in
 	''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
-	./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
+	./protochk "$externC $try" $hdrs && gethostent_r_proto=S_SBIE ;;
 	esac
 	case "$gethostent_r_proto" in
 	''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
-	./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
+	./protochk "$externC $try" $hdrs && gethostent_r_proto=S_SBI ;;
 	esac
 	case "$gethostent_r_proto" in
 	''|0) try='int gethostent_r(struct hostent*, char*, int);'
-	./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
+	./protochk "$externC $try" $hdrs && gethostent_r_proto=I_SBI ;;
 	esac
 	case "$gethostent_r_proto" in
 	''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
-	./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
+	./protochk "$externC $try" $hdrs && gethostent_r_proto=I_SD ;;
 	esac
 	case "$gethostent_r_proto" in
 	''|0)	d_gethostent_r=undef
@@ -13778,19 +13783,19 @@
 	define)
 	case "$getlogin_r_proto" in
 	''|0) try='int getlogin_r(char*, size_t);'
-	./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
+	./protochk "$externC $try" $hdrs && getlogin_r_proto=I_BW ;;
 	esac
 	case "$getlogin_r_proto" in
 	''|0) try='int getlogin_r(char*, int);'
-	./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
+	./protochk "$externC $try" $hdrs && getlogin_r_proto=I_BI ;;
 	esac
 	case "$getlogin_r_proto" in
 	''|0) try='char* getlogin_r(char*, size_t);'
-	./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
+	./protochk "$externC $try" $hdrs && getlogin_r_proto=B_BW ;;
 	esac
 	case "$getlogin_r_proto" in
 	''|0) try='char* getlogin_r(char*, int);'
-	./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
+	./protochk "$externC $try" $hdrs && getlogin_r_proto=B_BI ;;
 	esac
 	case "$getlogin_r_proto" in
 	''|0)	d_getlogin_r=undef
@@ -13851,35 +13856,35 @@
 	define)
 	case "$getnetbyaddr_r_proto" in
 	''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
-	./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
+	./protochk "$externC $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
 	esac
 	case "$getnetbyaddr_r_proto" in
 	''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
-	./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
+	./protochk "$externC $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
 	esac
 	case "$getnetbyaddr_r_proto" in
 	''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
-	./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
+	./protochk "$externC $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
 	esac
 	case "$getnetbyaddr_r_proto" in
 	''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
-	./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
+	./protochk "$externC $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
 	esac
 	case "$getnetbyaddr_r_proto" in
 	''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
-	./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
+	./protochk "$externC $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
 	esac
 	case "$getnetbyaddr_r_proto" in
 	''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
-	./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
+	./protochk "$externC $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
 	esac
 	case "$getnetbyaddr_r_proto" in
 	''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
-	./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
+	./protochk "$externC $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
 	esac
 	case "$getnetbyaddr_r_proto" in
 	''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
-	./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
+	./protochk "$externC $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
 	esac
 	case "$getnetbyaddr_r_proto" in
 	''|0)	d_getnetbyaddr_r=undef
@@ -13920,19 +13925,19 @@
 	define)
 	case "$getnetbyname_r_proto" in
 	''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
-	./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
+	./protochk "$externC $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
 	esac
 	case "$getnetbyname_r_proto" in
 	''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
-	./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
+	./protochk "$externC $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
 	esac
 	case "$getnetbyname_r_proto" in
 	''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
-	./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
+	./protochk "$externC $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
 	esac
 	case "$getnetbyname_r_proto" in
 	''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
-	./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
+	./protochk "$externC $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
 	esac
 	case "$getnetbyname_r_proto" in
 	''|0)	d_getnetbyname_r=undef
@@ -13973,27 +13978,27 @@
 	define)
 	case "$getnetent_r_proto" in
 	''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
-	./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
+	./protochk "$externC $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
 	esac
 	case "$getnetent_r_proto" in
 	''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
-	./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
+	./protochk "$externC $try" $hdrs && getnetent_r_proto=I_SBIE ;;
 	esac
 	case "$getnetent_r_proto" in
 	''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
-	./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
+	./protochk "$externC $try" $hdrs && getnetent_r_proto=S_SBIE ;;
 	esac
 	case "$getnetent_r_proto" in
 	''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
-	./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
+	./protochk "$externC $try" $hdrs && getnetent_r_proto=S_SBI ;;
 	esac
 	case "$getnetent_r_proto" in
 	''|0) try='int getnetent_r(struct netent*, char*, int);'
-	./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
+	./protochk "$externC $try" $hdrs && getnetent_r_proto=I_SBI ;;
 	esac
 	case "$getnetent_r_proto" in
 	''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
-	./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
+	./protochk "$externC $try" $hdrs && getnetent_r_proto=I_SD ;;
 	esac
 	case "$getnetent_r_proto" in
 	''|0)	d_getnetent_r=undef
@@ -14073,15 +14078,15 @@
 	define)
 	case "$getprotobyname_r_proto" in
 	''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
-	./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
+	./protochk "$externC $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
 	esac
 	case "$getprotobyname_r_proto" in
 	''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
-	./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
+	./protochk "$externC $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
 	esac
 	case "$getprotobyname_r_proto" in
 	''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
-	./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
+	./protochk "$externC $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
 	esac
 	case "$getprotobyname_r_proto" in
 	''|0)	d_getprotobyname_r=undef
@@ -14122,15 +14127,15 @@
 	define)
 	case "$getprotobynumber_r_proto" in
 	''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
-	./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
+	./protochk "$externC $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
 	esac
 	case "$getprotobynumber_r_proto" in
 	''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
-	./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
+	./protochk "$externC $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
 	esac
 	case "$getprotobynumber_r_proto" in
 	''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
-	./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
+	./protochk "$externC $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
 	esac
 	case "$getprotobynumber_r_proto" in
 	''|0)	d_getprotobynumber_r=undef
@@ -14171,19 +14176,19 @@
 	define)
 	case "$getprotoent_r_proto" in
 	''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
-	./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
+	./protochk "$externC $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
 	esac
 	case "$getprotoent_r_proto" in
 	''|0) try='int getprotoent_r(struct protoent*, char*, int);'
-	./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
+	./protochk "$externC $try" $hdrs && getprotoent_r_proto=I_SBI ;;
 	esac
 	case "$getprotoent_r_proto" in
 	''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
-	./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
+	./protochk "$externC $try" $hdrs && getprotoent_r_proto=S_SBI ;;
 	esac
 	case "$getprotoent_r_proto" in
 	''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
-	./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
+	./protochk "$externC $try" $hdrs && getprotoent_r_proto=I_SD ;;
 	esac
 	case "$getprotoent_r_proto" in
 	''|0)	d_getprotoent_r=undef
@@ -14237,27 +14242,27 @@
 	define)
 	case "$getpwent_r_proto" in
 	''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
-	./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
+	./protochk "$externC $try" $hdrs && getpwent_r_proto=I_SBWR ;;
 	esac
 	case "$getpwent_r_proto" in
 	''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
-	./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
+	./protochk "$externC $try" $hdrs && getpwent_r_proto=I_SBIR ;;
 	esac
 	case "$getpwent_r_proto" in
 	''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
-	./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
+	./protochk "$externC $try" $hdrs && getpwent_r_proto=S_SBW ;;
 	esac
 	case "$getpwent_r_proto" in
 	''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
-	./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
+	./protochk "$externC $try" $hdrs && getpwent_r_proto=S_SBI ;;
 	esac
 	case "$getpwent_r_proto" in
 	''|0) try='int getpwent_r(struct passwd*, char*, int);'
-	./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
+	./protochk "$externC $try" $hdrs && getpwent_r_proto=I_SBI ;;
 	esac
 	case "$getpwent_r_proto" in
 	''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
-	./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
+	./protochk "$externC $try" $hdrs && getpwent_r_proto=I_SBIH ;;
 	esac
 	case "$getpwent_r_proto" in
 	''|0)	d_getpwent_r=undef
@@ -14298,19 +14303,19 @@
 	define)
 	case "$getpwnam_r_proto" in
 	''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
-	./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
+	./protochk "$externC $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
 	esac
 	case "$getpwnam_r_proto" in
 	''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
-	./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
+	./protochk "$externC $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
 	esac
 	case "$getpwnam_r_proto" in
 	''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
-	./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
+	./protochk "$externC $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
 	esac
 	case "$getpwnam_r_proto" in
 	''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
-	./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
+	./protochk "$externC $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
 	esac
 	case "$getpwnam_r_proto" in
 	''|0)	d_getpwnam_r=undef
@@ -14351,19 +14356,19 @@
 	define)
 	case "$getpwuid_r_proto" in
 	''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
-	./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
+	./protochk "$externC $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
 	esac
 	case "$getpwuid_r_proto" in
 	''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
-	./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
+	./protochk "$externC $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
 	esac
 	case "$getpwuid_r_proto" in
 	''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
-	./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
+	./protochk "$externC $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
 	esac
 	case "$getpwuid_r_proto" in
 	''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
-	./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
+	./protochk "$externC $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
 	esac
 	case "$getpwuid_r_proto" in
 	''|0)	d_getpwuid_r=undef
@@ -14418,15 +14423,15 @@
 	define)
 	case "$getservbyname_r_proto" in
 	''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
-	./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
+	./protochk "$externC $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
 	esac
 	case "$getservbyname_r_proto" in
 	''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
-	./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
+	./protochk "$externC $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
 	esac
 	case "$getservbyname_r_proto" in
 	''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
-	./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
+	./protochk "$externC $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
 	esac
 	case "$getservbyname_r_proto" in
 	''|0)	d_getservbyname_r=undef
@@ -14467,15 +14472,15 @@
 	define)
 	case "$getservbyport_r_proto" in
 	''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
-	./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
+	./protochk "$externC $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
 	esac
 	case "$getservbyport_r_proto" in
 	''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
-	./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
+	./protochk "$externC $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
 	esac
 	case "$getservbyport_r_proto" in
 	''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
-	./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
+	./protochk "$externC $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
 	esac
 	case "$getservbyport_r_proto" in
 	''|0)	d_getservbyport_r=undef
@@ -14516,19 +14521,19 @@
 	define)
 	case "$getservent_r_proto" in
 	''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
-	./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
+	./protochk "$externC $try" $hdrs && getservent_r_proto=I_SBWR ;;
 	esac
 	case "$getservent_r_proto" in
 	''|0) try='int getservent_r(struct servent*, char*, int);'
-	./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
+	./protochk "$externC $try" $hdrs && getservent_r_proto=I_SBI ;;
 	esac
 	case "$getservent_r_proto" in
 	''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
-	./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
+	./protochk "$externC $try" $hdrs && getservent_r_proto=S_SBI ;;
 	esac
 	case "$getservent_r_proto" in
 	''|0) try='int getservent_r(struct servent*, struct servent_data*);'
-	./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
+	./protochk "$externC $try" $hdrs && getservent_r_proto=I_SD ;;
 	esac
 	case "$getservent_r_proto" in
 	''|0)	d_getservent_r=undef
@@ -14582,11 +14587,11 @@
 	define)
 	case "$getspnam_r_proto" in
 	''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
-	./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
+	./protochk "$externC $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
 	esac
 	case "$getspnam_r_proto" in
 	''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
-	./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
+	./protochk "$externC $try" $hdrs && getspnam_r_proto=S_CSBI ;;
 	esac
 	case "$getspnam_r_proto" in
 	''|0)	d_getspnam_r=undef
@@ -14646,11 +14651,11 @@
 	define)
 	case "$gmtime_r_proto" in
 	''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
-	./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
+	./protochk "$externC $try" $hdrs && gmtime_r_proto=S_TS ;;
 	esac
 	case "$gmtime_r_proto" in
 	''|0) try='int gmtime_r(const time_t*, struct tm*);'
-	./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
+	./protochk "$externC $try" $hdrs && gmtime_r_proto=I_TS ;;
 	esac
 	case "$gmtime_r_proto" in
 	''|0)	d_gmtime_r=undef
@@ -14926,11 +14931,11 @@
 	define)
 	case "$localtime_r_proto" in
 	''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
-	./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
+	./protochk "$externC $try" $hdrs && localtime_r_proto=S_TS ;;
 	esac
 	case "$localtime_r_proto" in
 	''|0) try='int localtime_r(const time_t*, struct tm*);'
-	./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
+	./protochk "$externC $try" $hdrs && localtime_r_proto=I_TS ;;
 	esac
 	case "$localtime_r_proto" in
 	''|0)	d_localtime_r=undef
@@ -14966,6 +14971,7 @@
 #include <unistd.h>
 #include <time.h>
 #include <string.h>
+#include <stdlib.h>
 #include <malloc.h>
 int main()
 {
@@ -16055,15 +16061,15 @@
 	define)
 	case "$random_r_proto" in
 	''|0) try='int random_r(int*, struct random_data*);'
-	./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
+	./protochk "$externC $try" $hdrs && random_r_proto=I_iS ;;
 	esac
 	case "$random_r_proto" in
 	''|0) try='int random_r(long*, struct random_data*);'
-	./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
+	./protochk "$externC $try" $hdrs && random_r_proto=I_lS ;;
 	esac
 	case "$random_r_proto" in
 	''|0) try='int random_r(struct random_data*, int32_t*);'
-	./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
+	./protochk "$externC $try" $hdrs && random_r_proto=I_St ;;
 	esac
 	case "$random_r_proto" in
 	''|0)	d_random_r=undef
@@ -16114,11 +16120,11 @@
 	define)
 	case "$readdir64_r_proto" in
 	''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
-	./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
+	./protochk "$externC $try" $hdrs && readdir64_r_proto=I_TSR ;;
 	esac
 	case "$readdir64_r_proto" in
 	''|0) try='int readdir64_r(DIR*, struct dirent64*);'
-	./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
+	./protochk "$externC $try" $hdrs && readdir64_r_proto=I_TS ;;
 	esac
 	case "$readdir64_r_proto" in
 	''|0)	d_readdir64_r=undef
@@ -16159,11 +16165,11 @@
 	define)
 	case "$readdir_r_proto" in
 	''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
-	./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
+	./protochk "$externC $try" $hdrs && readdir_r_proto=I_TSR ;;
 	esac
 	case "$readdir_r_proto" in
 	''|0) try='int readdir_r(DIR*, struct dirent*);'
-	./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
+	./protochk "$externC $try" $hdrs && readdir_r_proto=I_TS ;;
 	esac
 	case "$readdir_r_proto" in
 	''|0)	d_readdir_r=undef
@@ -16715,11 +16721,11 @@
 	define)
 	case "$setgrent_r_proto" in
 	''|0) try='int setgrent_r(FILE**);'
-	./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
+	./protochk "$externC $try" $hdrs && setgrent_r_proto=I_H ;;
 	esac
 	case "$setgrent_r_proto" in
 	''|0) try='void setgrent_r(FILE**);'
-	./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
+	./protochk "$externC $try" $hdrs && setgrent_r_proto=V_H ;;
 	esac
 	case "$setgrent_r_proto" in
 	''|0)	d_setgrent_r=undef
@@ -16764,11 +16770,11 @@
 	define)
 	case "$sethostent_r_proto" in
 	''|0) try='int sethostent_r(int, struct hostent_data*);'
-	./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
+	./protochk "$externC $try" $hdrs && sethostent_r_proto=I_ID ;;
 	esac
 	case "$sethostent_r_proto" in
 	''|0) try='void sethostent_r(int, struct hostent_data*);'
-	./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
+	./protochk "$externC $try" $hdrs && sethostent_r_proto=V_ID ;;
 	esac
 	case "$sethostent_r_proto" in
 	''|0)	d_sethostent_r=undef
@@ -16825,7 +16831,7 @@
 	define)
 	case "$setlocale_r_proto" in
 	''|0) try='int setlocale_r(int, const char*, char*, int);'
-	./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
+	./protochk "$externC $try" $hdrs && setlocale_r_proto=I_ICBI ;;
 	esac
 	case "$setlocale_r_proto" in
 	''|0)	d_setlocale_r=undef
@@ -16870,11 +16876,11 @@
 	define)
 	case "$setnetent_r_proto" in
 	''|0) try='int setnetent_r(int, struct netent_data*);'
-	./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
+	./protochk "$externC $try" $hdrs && setnetent_r_proto=I_ID ;;
 	esac
 	case "$setnetent_r_proto" in
 	''|0) try='void setnetent_r(int, struct netent_data*);'
-	./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
+	./protochk "$externC $try" $hdrs && setnetent_r_proto=V_ID ;;
 	esac
 	case "$setnetent_r_proto" in
 	''|0)	d_setnetent_r=undef
@@ -16935,11 +16941,11 @@
 	define)
 	case "$setprotoent_r_proto" in
 	''|0) try='int setprotoent_r(int, struct protoent_data*);'
-	./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
+	./protochk "$externC $try" $hdrs && setprotoent_r_proto=I_ID ;;
 	esac
 	case "$setprotoent_r_proto" in
 	''|0) try='void setprotoent_r(int, struct protoent_data*);'
-	./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
+	./protochk "$externC $try" $hdrs && setprotoent_r_proto=V_ID ;;
 	esac
 	case "$setprotoent_r_proto" in
 	''|0)	d_setprotoent_r=undef
@@ -16984,11 +16990,11 @@
 	define)
 	case "$setpwent_r_proto" in
 	''|0) try='int setpwent_r(FILE**);'
-	./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
+	./protochk "$externC $try" $hdrs && setpwent_r_proto=I_H ;;
 	esac
 	case "$setpwent_r_proto" in
 	''|0) try='void setpwent_r(FILE**);'
-	./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
+	./protochk "$externC $try" $hdrs && setpwent_r_proto=V_H ;;
 	esac
 	case "$setpwent_r_proto" in
 	''|0)	d_setpwent_r=undef
@@ -17053,11 +17059,11 @@
 	define)
 	case "$setservent_r_proto" in
 	''|0) try='int setservent_r(int, struct servent_data*);'
-	./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
+	./protochk "$externC $try" $hdrs && setservent_r_proto=I_ID ;;
 	esac
 	case "$setservent_r_proto" in
 	''|0) try='void setservent_r(int, struct servent_data*);'
-	./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
+	./protochk "$externC $try" $hdrs && setservent_r_proto=V_ID ;;
 	esac
 	case "$setservent_r_proto" in
 	''|0)	d_setservent_r=undef
@@ -17533,7 +17539,7 @@
 	define)
 	case "$srand48_r_proto" in
 	''|0) try='int srand48_r(long, struct drand48_data*);'
-	./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
+	./protochk "$externC $try" $hdrs && srand48_r_proto=I_LS ;;
 	esac
 	case "$srand48_r_proto" in
 	''|0)	d_srand48_r=undef
@@ -17574,7 +17580,7 @@
 	define)
 	case "$srandom_r_proto" in
 	''|0) try='int srandom_r(unsigned int, struct random_data*);'
-	./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
+	./protochk "$externC $try" $hdrs && srandom_r_proto=I_TS ;;
 	esac
 	case "$srandom_r_proto" in
 	''|0)	d_srandom_r=undef
@@ -17775,15 +17781,15 @@
 	define)
 	case "$strerror_r_proto" in
 	''|0) try='int strerror_r(int, char*, size_t);'
-	./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
+	./protochk "$externC $try" $hdrs && strerror_r_proto=I_IBW ;;
 	esac
 	case "$strerror_r_proto" in
 	''|0) try='int strerror_r(int, char*, int);'
-	./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
+	./protochk "$externC $try" $hdrs && strerror_r_proto=I_IBI ;;
 	esac
 	case "$strerror_r_proto" in
 	''|0) try='char* strerror_r(int, char*, size_t);'
-	./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
+	./protochk "$externC $try" $hdrs && strerror_r_proto=B_IBW ;;
 	esac
 	case "$strerror_r_proto" in
 	''|0)	d_strerror_r=undef
@@ -18185,7 +18191,7 @@
 	define)
 	case "$tmpnam_r_proto" in
 	''|0) try='char* tmpnam_r(char*);'
-	./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
+	./protochk "$externC $try" $hdrs && tmpnam_r_proto=B_B ;;
 	esac
 	case "$tmpnam_r_proto" in
 	''|0)	d_tmpnam_r=undef
@@ -18230,15 +18236,15 @@
 	define)
 	case "$ttyname_r_proto" in
 	''|0) try='int ttyname_r(int, char*, size_t);'
-	./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
+	./protochk "$externC $try" $hdrs && ttyname_r_proto=I_IBW ;;
 	esac
 	case "$ttyname_r_proto" in
 	''|0) try='int ttyname_r(int, char*, int);'
-	./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
+	./protochk "$externC $try" $hdrs && ttyname_r_proto=I_IBI ;;
 	esac
 	case "$ttyname_r_proto" in
 	''|0) try='char* ttyname_r(int, char*, int);'
-	./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
+	./protochk "$externC $try" $hdrs && ttyname_r_proto=B_IBI ;;
 	esac
 	case "$ttyname_r_proto" in
 	''|0)	d_ttyname_r=undef
@@ -19846,7 +19852,7 @@
 		for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
 			for yyy in size_t long int; do
 				case "$netdb_host_type" in
-				'')	try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
+				'')	try="$externC struct hostent *gethostbyaddr($xxx, $yyy, int);"
 					if ./protochk "$try" $hdrs; then
 						echo "Your system accepts $xxx for the first arg."
 						echo "...and $yyy for the second arg."
@@ -19895,7 +19901,7 @@
 			$i_unistd unistd.h"
 		for xxx in "const char *" "char *"; do
 			case "$netdb_name_type" in
-			'')	try="extern struct hostent *gethostbyname($xxx);"
+			'')	try="$externC struct hostent *gethostbyname($xxx);"
 				if ./protochk "$try" $hdrs; then
 					echo "Your system accepts $xxx."
 					netdb_name_type="$xxx"
@@ -19933,7 +19939,7 @@
 			$i_unistd unistd.h"
 		for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
 			case "$netdb_net_type" in
-			'')	try="extern struct netent *getnetbyaddr($xxx, int);"
+			'')	try="$externC struct netent *getnetbyaddr($xxx, int);"
 				if ./protochk "$try" $hdrs; then
 					echo "Your system accepts $xxx."
 					netdb_net_type="$xxx"
@@ -20236,7 +20242,7 @@
 			for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
 				for tmo in 'struct timeval *' 'const struct timeval *'; do
 					case "$val" in
-					'')	try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
+					'')	try="$externC select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
 						if ./protochk "$try" $hdrs; then
 							echo "Your system accepts $xxx."
 							val="$xxx"
@@ -20717,7 +20723,7 @@
 	yyy="$yyy $sizetype int long unsigned"
 	for xxx in $yyy; do
 		case "$socksizetype" in
-		'')	try="extern int accept(int, struct sockaddr *, $xxx *);"
+		'')	try="$externC int accept(int, struct sockaddr *, $xxx *);"
 			case "$usesocks" in
 			"$define")
 				if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then

signature.asc


Follow-Ups from:
"H.Merijn Brand" <h.m.brand@xs4all.nl>
"H.Merijn Brand" <h.m.brand@xs4all.nl>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]