aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-07-31 22:42:34 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-07-31 22:42:34 +0000
commitc3c7739811fc2231182d2b46f5fd42e44007dd2c (patch)
tree0533b7c75a34827e2f9a5a9963d47e2852c870e5 /lib
parent513ac758daec3b60e02b2b96cc8dab05afb2adf4 (diff)
big last-beta (?) cleanup commit
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.in129
-rw-r--r--lib/getdate.c111
-rw-r--r--lib/getdate.y5
-rw-r--r--lib/http.c11
4 files changed, 159 insertions, 97 deletions
diff --git a/lib/Makefile.in b/lib/Makefile.in
index fb7adccee..a88678ecb 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -63,9 +63,14 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
+AS = @AS@
CC = @CC@
+DLLTOOL = @DLLTOOL@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
MAKEINFO = @MAKEINFO@
NROFF = @NROFF@
+OBJDUMP = @OBJDUMP@
PACKAGE = @PACKAGE@
PERL = @PERL@
RANLIB = @RANLIB@
@@ -74,35 +79,37 @@ YACC = @YACC@
AUTOMAKE_OPTIONS = foreign no-dependencies
-noinst_LIBRARIES = libcurl.a
+lib_LTLIBRARIES = libcurl.la
# Some flags needed when trying to cause warnings ;-)
-CFLAGS = -g -Wall #-pedantic
+# CFLAGS = -g -Wall #-pedantic
INCLUDES = -I$(top_srcdir)/include
-libcurl_a_SOURCES = arpa_telnet.h file.c getpass.h netrc.h timeval.c base64.c file.h hostip.c progress.c timeval.h base64.h formdata.c hostip.h progress.h cookie.c formdata.h http.c sendf.c cookie.h ftp.c http.h sendf.h url.c dict.c ftp.h if2ip.c speedcheck.c url.h dict.h getdate.c if2ip.h speedcheck.h urldata.h download.c getdate.h ldap.c ssluse.c version.c download.h getenv.c ldap.h ssluse.h escape.c getenv.h mprintf.c telnet.c escape.h getpass.c netrc.c telnet.h writeout.c writeout.h highlevel.c strequal.c strequal.h easy.c
+libcurl_la_SOURCES = arpa_telnet.h file.c getpass.h netrc.h timeval.c base64.c file.h hostip.c progress.c timeval.h base64.h formdata.c hostip.h progress.h cookie.c formdata.h http.c sendf.c cookie.h ftp.c http.h sendf.h url.c dict.c ftp.h if2ip.c speedcheck.c url.h dict.h getdate.c if2ip.h speedcheck.h urldata.h download.c getdate.h ldap.c ssluse.c version.c download.h getenv.c ldap.h ssluse.h escape.c getenv.h mprintf.c telnet.c escape.h getpass.c netrc.c telnet.h writeout.c writeout.h highlevel.c strequal.c strequal.h easy.c
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h ../src/config.h
CONFIG_CLEAN_FILES =
-LIBRARIES = $(noinst_LIBRARIES)
+LTLIBRARIES = $(lib_LTLIBRARIES)
DEFS = @DEFS@ -I. -I$(srcdir) -I.. -I../src
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
-libcurl_a_LIBADD =
-libcurl_a_OBJECTS = file.o timeval.o base64.o hostip.o progress.o \
-formdata.o cookie.o http.o sendf.o ftp.o url.o dict.o if2ip.o \
-speedcheck.o getdate.o download.o ldap.o ssluse.o version.o getenv.o \
-escape.o mprintf.o telnet.o getpass.o netrc.o writeout.o highlevel.o \
-strequal.o easy.o
-AR = ar
+libcurl_la_LDFLAGS =
+libcurl_la_LIBADD =
+libcurl_la_OBJECTS = file.lo timeval.lo base64.lo hostip.lo progress.lo \
+formdata.lo cookie.lo http.lo sendf.lo ftp.lo url.lo dict.lo if2ip.lo \
+speedcheck.lo getdate.lo download.lo ldap.lo ssluse.lo version.lo \
+getenv.lo escape.lo mprintf.lo telnet.lo getpass.lo netrc.lo \
+writeout.lo highlevel.lo strequal.lo easy.lo
+CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
DIST_COMMON = Makefile.am Makefile.in
@@ -110,28 +117,44 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = gtar
GZIP_ENV = --best
-SOURCES = $(libcurl_a_SOURCES)
-OBJECTS = $(libcurl_a_OBJECTS)
+SOURCES = $(libcurl_la_SOURCES)
+OBJECTS = $(libcurl_la_OBJECTS)
all: all-redirect
.SUFFIXES:
-.SUFFIXES: .S .c .o .s
+.SUFFIXES: .S .c .lo .o .s
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/Makefile
+ cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps lib/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-mostlyclean-noinstLIBRARIES:
+mostlyclean-libLTLIBRARIES:
-clean-noinstLIBRARIES:
- -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+clean-libLTLIBRARIES:
+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-distclean-noinstLIBRARIES:
+distclean-libLTLIBRARIES:
-maintainer-clean-noinstLIBRARIES:
+maintainer-clean-libLTLIBRARIES:
+
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(libdir)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \
+ $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \
+ else :; fi; \
+ done
+
+uninstall-libLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
+ done
.c.o:
$(COMPILE) -c $<
@@ -152,10 +175,27 @@ distclean-compile:
maintainer-clean-compile:
-libcurl.a: $(libcurl_a_OBJECTS) $(libcurl_a_DEPENDENCIES)
- -rm -f libcurl.a
- $(AR) cru libcurl.a $(libcurl_a_OBJECTS) $(libcurl_a_LIBADD)
- $(RANLIB) libcurl.a
+.c.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.S.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+
+maintainer-clean-libtool:
+
+libcurl.la: $(libcurl_la_OBJECTS) $(libcurl_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(libcurl_la_LDFLAGS) $(libcurl_la_OBJECTS) $(libcurl_la_LIBADD) $(LIBS)
tags: TAGS
@@ -209,7 +249,7 @@ check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
-install-exec-am:
+install-exec-am: install-libLTLIBRARIES
install-exec: install-exec-am
install-data-am:
@@ -218,13 +258,14 @@ install-data: install-data-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
-uninstall-am:
+uninstall-am: uninstall-libLTLIBRARIES
uninstall: uninstall-am
-all-am: Makefile $(LIBRARIES)
+all-am: Makefile $(LTLIBRARIES)
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(libdir)
mostlyclean-generic:
@@ -236,33 +277,39 @@ distclean-generic:
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
-mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
- mostlyclean-tags mostlyclean-generic
+mostlyclean-am: mostlyclean-libLTLIBRARIES mostlyclean-compile \
+ mostlyclean-libtool mostlyclean-tags \
+ mostlyclean-generic
mostlyclean: mostlyclean-am
-clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \
- mostlyclean-am
+clean-am: clean-libLTLIBRARIES clean-compile clean-libtool clean-tags \
+ clean-generic mostlyclean-am
clean: clean-am
-distclean-am: distclean-noinstLIBRARIES distclean-compile \
- distclean-tags distclean-generic clean-am
+distclean-am: distclean-libLTLIBRARIES distclean-compile \
+ distclean-libtool distclean-tags distclean-generic \
+ clean-am
+ -rm -f libtool
distclean: distclean-am
-maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
- maintainer-clean-compile maintainer-clean-tags \
- maintainer-clean-generic distclean-am
+maintainer-clean-am: maintainer-clean-libLTLIBRARIES \
+ maintainer-clean-compile maintainer-clean-libtool \
+ maintainer-clean-tags maintainer-clean-generic \
+ distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
maintainer-clean: maintainer-clean-am
-.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
-clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
-mostlyclean-compile distclean-compile clean-compile \
-maintainer-clean-compile tags mostlyclean-tags distclean-tags \
+.PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \
+clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \
+uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \
+distclean-compile clean-compile maintainer-clean-compile \
+mostlyclean-libtool distclean-libtool clean-libtool \
+maintainer-clean-libtool tags mostlyclean-tags distclean-tags \
clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \
check-am installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
diff --git a/lib/getdate.c b/lib/getdate.c
index 383f02d84..edebf4e06 100644
--- a/lib/getdate.c
+++ b/lib/getdate.c
@@ -32,6 +32,10 @@
** This code is in the public domain and has no copyright.
*/
+#define _REENTRANT /* Necessary to use in Solaris, since the silly guys at Sun
+ made the localtime_r() prototype dependent on it (or
+ _POSIX_C_SOURCE or _POSIX_PTHREAD_SEMANTICS). */
+
#ifdef HAVE_CONFIG_H
# include "config.h"
# ifdef HAVE_ALLOCA_H
@@ -215,7 +219,7 @@ static int yyRelSeconds;
static int yyRelYear;
-#line 198 "getdate.y"
+#line 202 "getdate.y"
typedef union {
int Number;
enum _MERIDIAN Meridian;
@@ -298,11 +302,11 @@ static const short yyrhs[] = { -1,
#if YYDEBUG != 0
static const short yyrline[] = { 0,
- 214, 215, 218, 221, 224, 227, 230, 233, 236, 242,
- 248, 257, 263, 275, 278, 281, 287, 291, 295, 301,
- 305, 323, 329, 335, 339, 344, 348, 355, 363, 366,
- 369, 372, 375, 378, 381, 384, 387, 390, 393, 396,
- 399, 402, 405, 408, 411, 414, 417, 422, 455, 459
+ 218, 219, 222, 225, 228, 231, 234, 237, 240, 246,
+ 252, 261, 267, 279, 282, 285, 291, 295, 299, 305,
+ 309, 327, 333, 339, 343, 348, 352, 359, 367, 370,
+ 373, 376, 379, 382, 385, 388, 391, 394, 397, 400,
+ 403, 406, 409, 412, 415, 418, 421, 426, 459, 463
};
#endif
@@ -926,37 +930,37 @@ yyreduce:
switch (yyn) {
case 3:
-#line 218 "getdate.y"
+#line 222 "getdate.y"
{
yyHaveTime++;
;
break;}
case 4:
-#line 221 "getdate.y"
+#line 225 "getdate.y"
{
yyHaveZone++;
;
break;}
case 5:
-#line 224 "getdate.y"
+#line 228 "getdate.y"
{
yyHaveDate++;
;
break;}
case 6:
-#line 227 "getdate.y"
+#line 231 "getdate.y"
{
yyHaveDay++;
;
break;}
case 7:
-#line 230 "getdate.y"
+#line 234 "getdate.y"
{
yyHaveRel++;
;
break;}
case 9:
-#line 236 "getdate.y"
+#line 240 "getdate.y"
{
yyHour = yyvsp[-1].Number;
yyMinutes = 0;
@@ -965,7 +969,7 @@ case 9:
;
break;}
case 10:
-#line 242 "getdate.y"
+#line 246 "getdate.y"
{
yyHour = yyvsp[-3].Number;
yyMinutes = yyvsp[-1].Number;
@@ -974,7 +978,7 @@ case 10:
;
break;}
case 11:
-#line 248 "getdate.y"
+#line 252 "getdate.y"
{
yyHour = yyvsp[-3].Number;
yyMinutes = yyvsp[-1].Number;
@@ -986,7 +990,7 @@ case 11:
;
break;}
case 12:
-#line 257 "getdate.y"
+#line 261 "getdate.y"
{
yyHour = yyvsp[-5].Number;
yyMinutes = yyvsp[-3].Number;
@@ -995,7 +999,7 @@ case 12:
;
break;}
case 13:
-#line 263 "getdate.y"
+#line 267 "getdate.y"
{
yyHour = yyvsp[-5].Number;
yyMinutes = yyvsp[-3].Number;
@@ -1008,53 +1012,53 @@ case 13:
;
break;}
case 14:
-#line 275 "getdate.y"
+#line 279 "getdate.y"
{
yyTimezone = yyvsp[0].Number;
;
break;}
case 15:
-#line 278 "getdate.y"
+#line 282 "getdate.y"
{
yyTimezone = yyvsp[0].Number - 60;
;
break;}
case 16:
-#line 282 "getdate.y"
+#line 286 "getdate.y"
{
yyTimezone = yyvsp[-1].Number - 60;
;
break;}
case 17:
-#line 287 "getdate.y"
+#line 291 "getdate.y"
{
yyDayOrdinal = 1;
yyDayNumber = yyvsp[0].Number;
;
break;}
case 18:
-#line 291 "getdate.y"
+#line 295 "getdate.y"
{
yyDayOrdinal = 1;
yyDayNumber = yyvsp[-1].Number;
;
break;}
case 19:
-#line 295 "getdate.y"
+#line 299 "getdate.y"
{
yyDayOrdinal = yyvsp[-1].Number;
yyDayNumber = yyvsp[0].Number;
;
break;}
case 20:
-#line 301 "getdate.y"
+#line 305 "getdate.y"
{
yyMonth = yyvsp[-2].Number;
yyDay = yyvsp[0].Number;
;
break;}
case 21:
-#line 305 "getdate.y"
+#line 309 "getdate.y"
{
/* Interpret as YYYY/MM/DD if $1 >= 1000, otherwise as MM/DD/YY.
The goal in recognizing YYYY/MM/DD is solely to support legacy
@@ -1075,7 +1079,7 @@ case 21:
;
break;}
case 22:
-#line 323 "getdate.y"
+#line 327 "getdate.y"
{
/* ISO 8601 format. yyyy-mm-dd. */
yyYear = yyvsp[-2].Number;
@@ -1084,7 +1088,7 @@ case 22:
;
break;}
case 23:
-#line 329 "getdate.y"
+#line 333 "getdate.y"
{
/* e.g. 17-JUN-1992. */
yyDay = yyvsp[-2].Number;
@@ -1093,14 +1097,14 @@ case 23:
;
break;}
case 24:
-#line 335 "getdate.y"
+#line 339 "getdate.y"
{
yyMonth = yyvsp[-1].Number;
yyDay = yyvsp[0].Number;
;
break;}
case 25:
-#line 339 "getdate.y"
+#line 343 "getdate.y"
{
yyMonth = yyvsp[-3].Number;
yyDay = yyvsp[-2].Number;
@@ -1108,14 +1112,14 @@ case 25:
;
break;}
case 26:
-#line 344 "getdate.y"
+#line 348 "getdate.y"
{
yyMonth = yyvsp[0].Number;
yyDay = yyvsp[-1].Number;
;
break;}
case 27:
-#line 348 "getdate.y"
+#line 352 "getdate.y"
{
yyMonth = yyvsp[-1].Number;
yyDay = yyvsp[-2].Number;
@@ -1123,7 +1127,7 @@ case 27:
;
break;}
case 28:
-#line 355 "getdate.y"
+#line 359 "getdate.y"
{
yyRelSeconds = -yyRelSeconds;
yyRelMinutes = -yyRelMinutes;
@@ -1134,115 +1138,115 @@ case 28:
;
break;}
case 30:
-#line 366 "getdate.y"
+#line 370 "getdate.y"
{
yyRelYear += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 31:
-#line 369 "getdate.y"
+#line 373 "getdate.y"
{
yyRelYear += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 32:
-#line 372 "getdate.y"
+#line 376 "getdate.y"
{
yyRelYear += yyvsp[0].Number;
;
break;}
case 33:
-#line 375 "getdate.y"
+#line 379 "getdate.y"
{
yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 34:
-#line 378 "getdate.y"
+#line 382 "getdate.y"
{
yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 35:
-#line 381 "getdate.y"
+#line 385 "getdate.y"
{
yyRelMonth += yyvsp[0].Number;
;
break;}
case 36:
-#line 384 "getdate.y"
+#line 388 "getdate.y"
{
yyRelDay += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 37:
-#line 387 "getdate.y"
+#line 391 "getdate.y"
{
yyRelDay += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 38:
-#line 390 "getdate.y"
+#line 394 "getdate.y"
{
yyRelDay += yyvsp[0].Number;
;
break;}
case 39:
-#line 393 "getdate.y"
+#line 397 "getdate.y"
{
yyRelHour += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 40:
-#line 396 "getdate.y"
+#line 400 "getdate.y"
{
yyRelHour += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 41:
-#line 399 "getdate.y"
+#line 403 "getdate.y"
{
yyRelHour += yyvsp[0].Number;
;
break;}
case 42:
-#line 402 "getdate.y"
+#line 406 "getdate.y"
{
yyRelMinutes += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 43:
-#line 405 "getdate.y"
+#line 409 "getdate.y"
{
yyRelMinutes += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 44:
-#line 408 "getdate.y"
+#line 412 "getdate.y"
{
yyRelMinutes += yyvsp[0].Number;
;
break;}
case 45:
-#line 411 "getdate.y"
+#line 415 "getdate.y"
{
yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 46:
-#line 414 "getdate.y"
+#line 418 "getdate.y"
{
yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 47:
-#line 417 "getdate.y"
+#line 421 "getdate.y"
{
yyRelSeconds += yyvsp[0].Number;
;
break;}
case 48:
-#line 423 "getdate.y"
+#line 427 "getdate.y"
{
if (yyHaveTime && yyHaveDate && !yyHaveRel)
yyYear = yyvsp[0].Number;
@@ -1275,13 +1279,13 @@ case 48:
;
break;}
case 49:
-#line 456 "getdate.y"
+#line 460 "getdate.y"
{
yyval.Meridian = MER24;
;
break;}
case 50:
-#line 460 "getdate.y"
+#line 464 "getdate.y"
{
yyval.Meridian = yyvsp[0].Meridian;
;
@@ -1508,7 +1512,7 @@ yyerrhandle:
}
return 1;
}
-#line 465 "getdate.y"
+#line 469 "getdate.y"
/* Include this file down here because bison inserts code above which
@@ -1518,7 +1522,6 @@ yyerrhandle:
extern struct tm *gmtime ();
extern struct tm *localtime ();
-extern struct tm *localtime_r (time_t *, struct tm *);
extern time_t mktime ();
/* Month and day table. */
diff --git a/lib/getdate.y b/lib/getdate.y
index bdcf9d91e..5e1a76397 100644
--- a/lib/getdate.y
+++ b/lib/getdate.y
@@ -8,6 +8,10 @@
** This code is in the public domain and has no copyright.
*/
+#define _REENTRANT /* Necessary to use in Solaris, since the silly guys at Sun
+ made the localtime_r() prototype dependent on it (or
+ _POSIX_C_SOURCE or _POSIX_PTHREAD_SEMANTICS). */
+
#ifdef HAVE_CONFIG_H
# include "config.h"
# ifdef HAVE_ALLOCA_H
@@ -471,7 +475,6 @@ o_merid : /* NULL */
extern struct tm *gmtime ();
extern struct tm *localtime ();
-extern struct tm *localtime_r (time_t *, struct tm *);
extern time_t mktime ();
/* Month and day table. */
diff --git a/lib/http.c b/lib/http.c
index f6b626606..d05e73cf0 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -38,6 +38,10 @@
* ------------------------------------------------------------
****************************************************************************/
+#define _REENTRANT /* Necessary to use in Solaris, since the silly guys at Sun
+ made the localtime_r() prototype dependent on it (or
+ _POSIX_C_SOURCE or _POSIX_PTHREAD_SEMANTICS). */
+
/* -- WIN32 approved -- */
#include <stdio.h>
#include <string.h>
@@ -62,6 +66,12 @@
#include <netinet/in.h>
#include <sys/time.h>
+#ifdef HAVE_TIME_H
+#ifdef TIME_WITH_SYS_TIME
+#include <time.h>
+#endif
+#endif
+
#include <sys/resource.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -362,7 +372,6 @@ CURLcode http(struct connectdata *conn)
struct tm *thistime;
#ifdef HAVE_LOCALTIME_R
- extern struct tm *localtime_r(time_t *, struct tm *);
/* thread-safe version */
struct tm keeptime;
thistime = localtime_r(&data->timevalue, &keeptime);