From: Edin Kadribasic Date: Thu, 4 Nov 2004 02:22:10 +0000 (+0000) Subject: MFH: zend_strtod compilation on windows X-Git-Tag: php-5.0.3RC1~90 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9891d3e03d35bd135db33a1d37c675579b64d1ee;p=php MFH: zend_strtod compilation on windows --- diff --git a/Zend/Zend.dsp b/Zend/Zend.dsp index 6bf9b43416..83791c0c4a 100644 --- a/Zend/Zend.dsp +++ b/Zend/Zend.dsp @@ -7,20 +7,20 @@ CFG=Zend - Win32 Release_inline !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "Zend.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "Zend.mak" CFG="Zend - Win32 Release_inline" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "Zend - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "Zend - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE "Zend - Win32 Release_inline" (based on "Win32 (x86) Static Library") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 @@ -95,7 +95,7 @@ LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo -!ENDIF +!ENDIF # Begin Target @@ -135,10 +135,6 @@ SOURCE=.\zend_default_classes.c # End Source File # Begin Source File -SOURCE=.\zend_interfaces.c -# End Source File -# Begin Source File - SOURCE=.\zend_dynamic_array.c # End Source File # Begin Source File @@ -179,6 +175,10 @@ SOURCE=.\zend_ini_scanner.c # End Source File # Begin Source File +SOURCE=.\zend_interfaces.c +# End Source File +# Begin Source File + SOURCE=".\zend_language_parser.c" # End Source File # Begin Source File @@ -243,6 +243,10 @@ SOURCE=.\zend_stream.c # End Source File # Begin Source File +SOURCE=.\zend_strtod.c +# End Source File +# Begin Source File + SOURCE=.\zend_ts_hash.c # End Source File # Begin Source File @@ -291,10 +295,6 @@ SOURCE=.\zend_default_classes.h # End Source File # Begin Source File -SOURCE=.\zend_interfaces.h -# End Source File -# Begin Source File - SOURCE=.\zend_dynamic_array.h # End Source File # Begin Source File @@ -351,6 +351,10 @@ SOURCE=.\zend_ini_scanner.h # End Source File # Begin Source File +SOURCE=.\zend_interfaces.h +# End Source File +# Begin Source File + SOURCE=.\zend_istdiostream.h # End Source File # Begin Source File @@ -415,6 +419,10 @@ SOURCE=.\zend_stream.h # End Source File # Begin Source File +SOURCE=.\zend_strtod.h +# End Source File +# Begin Source File + SOURCE=.\zend_ts_hash.h # End Source File # Begin Source File @@ -449,7 +457,7 @@ BuildCmds= \ !ELSEIF "$(CFG)" == "Zend - Win32 Release_inline" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -504,7 +512,7 @@ BuildCmds= \ $(BuildCmds) # End Custom Build -!ENDIF +!ENDIF # End Source File # End Group @@ -533,7 +541,7 @@ InputPath=.\zend_ini_scanner.l !ELSEIF "$(CFG)" == "Zend - Win32 Release_inline" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -570,7 +578,7 @@ InputPath=".\zend_language_scanner.l" # End Custom Build -!ENDIF +!ENDIF # End Source File # End Group diff --git a/Zend/ZendTS.dsp b/Zend/ZendTS.dsp index 76b4e46e5f..830f97efd2 100644 --- a/Zend/ZendTS.dsp +++ b/Zend/ZendTS.dsp @@ -276,6 +276,10 @@ SOURCE=.\zend_stream.c # End Source File # Begin Source File +SOURCE=.\zend_strtod.c +# End Source File +# Begin Source File + SOURCE=.\zend_ts_hash.c # End Source File # Begin Source File @@ -452,6 +456,10 @@ SOURCE=.\zend_stream.h # End Source File # Begin Source File +SOURCE=.\zend_strtod.h +# End Source File +# Begin Source File + SOURCE=.\zend_ts_hash.h # End Source File # Begin Source File diff --git a/Zend/zend_strtod.c b/Zend/zend_strtod.c index 4fe98f3ed9..9fbaf38838 100644 --- a/Zend/zend_strtod.c +++ b/Zend/zend_strtod.c @@ -89,6 +89,8 @@ * directly -- and assumed always to succeed. */ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char *rcsid = "$OpenBSD: strtod.c,v 1.19 2004/02/03 16:52:11 drahn Exp $"; #endif /* LIBC_SCCS and not lint */ @@ -118,6 +120,12 @@ static char *rcsid = "$OpenBSD: strtod.c,v 1.19 2004/02/03 16:52:11 drahn Exp $" #define VAX #endif +#if defined(_MSC_VER) +#define int32_t __int32 +#define u_int32_t unsigned __int32 +#define IEEE_LITTLE_ENDIAN +#endif + #define Long int32_t #define ULong u_int32_t @@ -362,10 +370,6 @@ extern double rnd_prod(double, double), rnd_quot(double, double); #define Kmax 15 -#ifdef __cplusplus -extern "C" double zend_strtod(const char *s00, char **se); -#endif - struct Bigint { struct Bigint *next; @@ -1215,7 +1219,7 @@ static CONST double tinytens[] = { 1e-16, 1e-32 }; #endif #endif - double +ZEND_API double zend_strtod #ifdef KR_headers (s00, se) CONST char *s00; char **se; diff --git a/Zend/zend_strtod.h b/Zend/zend_strtod.h index 3c7820645e..2fbaceaedd 100644 --- a/Zend/zend_strtod.h +++ b/Zend/zend_strtod.h @@ -22,7 +22,10 @@ * can be found in zend_strtod.c */ #ifndef ZEND_STRTOD_H #define ZEND_STRTOD_H +#include -double zend_strtod(const char *s00, char **se); +BEGIN_EXTERN_C() +ZEND_API double zend_strtod(const char *s00, char **se); +END_EXTERN_C() #endif diff --git a/win32/build/config.w32 b/win32/build/config.w32 index d1882da73d..14f74d9ec3 100644 --- a/win32/build/config.w32 +++ b/win32/build/config.w32 @@ -183,7 +183,7 @@ ADD_SOURCES("Zend", "zend_language_parser.c zend_language_scanner.c \ zend_sprintf.c zend_ini.c zend_qsort.c zend_multibyte.c zend_ts_hash.c \ zend_stream.c zend_iterators.c zend_interfaces.c zend_objects.c \ zend_object_handlers.c zend_objects_API.c \ - zend_mm.c zend_default_classes.c zend_reflection_api.c zend_execute.c"); + zend_mm.c zend_default_classes.c zend_reflection_api.c zend_execute.c zend_strtod.c"); ADD_SOURCES("main", "main.c snprintf.c spprintf.c safe_mode.c fopen_wrappers.c \ php_scandir.c php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \