From da06e60fb5a095a91c9a4f509466667878624cb3 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 3 Nov 2015 15:08:31 -0500 Subject: Revert "Revert "Revert "Cleanup some numeric code.""" This reverts commit e0e922db5fb77df9a5a9cc802096f484ed21da1c. Broke Windows build. FAILED: ninja -t msvc -e environment.x86 -- "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64_x86\cl.exe" /nologo /showIncludes /FC @obj\core\src\fxcrt\fxcrt.fx_basic_gcc.obj.rsp /c ..\..\core\src\fxcrt\fx_basic_gcc.cpp /Foobj\core\src\fxcrt\fxcrt.fx_basic_gcc.obj /Fdobj\fxcrt.cc.pdb e:\b\build\slave\windows\build\pdfium\core\src\fxcrt\fx_basic_gcc.cpp(28) : error C2220: warning treated as error - no 'object' file generated e:\b\build\slave\windows\build\pdfium\core\src\fxcrt\fx_basic_gcc.cpp(75) : see reference to function template instantiation 'T FXSYS_StrToInt(STR_T)' being compiled with [ T=int32_t , STR_T=const FX_WCHAR * ] e:\b\build\slave\windows\build\pdfium\core\src\fxcrt\fx_basic_gcc.cpp(28) : warning C4244: 'argument' : conversion from 'const FX_WCHAR' to 'char', possible loss of data FAILED: ninja -t msvc -e environment.x86 -- "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64_x86\cl.exe" /nologo /showIncludes /FC @obj\core\src\fpdftext\fpdftext.fpdf_text.obj.rsp /c ..\..\core\src\fpdftext\fpdf_text.cpp /Foobj\core\src\fpdftext\fpdftext.fpdf_text.obj /Fdobj\fpdftext.cc.pdb e:\b\build\slave\windows\build\pdfium\core\src\fpdftext\fpdf_text.cpp(439) : error C2039: 'isdigit' : is not a member of 'std' FAILED: ninja -t msvc -e environment.x86 -- "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64_x86\cl.exe" /nologo /showIncludes /FC @obj\core\src\fxcrt\fxcrt.fx_basic_wstring.obj.rsp /c ..\..\core\src\fxcrt\fx_basic_wstring.cpp /Foobj\core\src\fxcrt\fxcrt.fx_basic_wstring.obj /Fdobj\fxcrt.cc.pdb e:\b\build\slave\windows\build\pdfium\core\src\fxcrt\fx_basic_wstring.cpp(973) : error C2220: warning treated as error - no 'object' file generated e:\b\build\slave\windows\build\pdfium\core\src\fxcrt\fx_basic_wstring.cpp(973) : warning C4244: 'argument' : conversion from 'const FX_WCHAR' to 'char', possible loss of data e:\b\build\slave\windows\build\pdfium\core\src\fxcrt\fx_basic_wstring.cpp(981) : warning C4244: 'argument' : conversion from 'const FX_WCHAR' to 'char', possible loss of data FAILED: ninja -t msvc -e environment.x86 -- "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64_x86\cl.exe" /nologo /showIncludes /FC @obj\core\src\fpdftext\fpdftext.fpdf_text_int.obj.rsp /c ..\..\core\src\fpdftext\fpdf_text_int.cpp /Foobj\core\src\fpdftext\fpdftext.fpdf_text_int.obj /Fdobj\fpdftext.cc.pdb e:\b\build\slave\windows\build\pdfium\core\src\fpdftext\fpdf_text_int.cpp(2436) : error C2039: 'isdigit' : is not a member of 'std' e:\b\build\slave\windows\build\pdfium\core\src\fpdftext\fpdf_text_int.cpp(2440) : error C2039: 'isdigit' : is not a member of 'std' ninja: build stopped: subcommand failed. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1431683008 . --- core/src/fxcrt/fx_extension.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'core/src/fxcrt/fx_extension.cpp') diff --git a/core/src/fxcrt/fx_extension.cpp b/core/src/fxcrt/fx_extension.cpp index 4951fbde9c..d64a06d08b 100644 --- a/core/src/fxcrt/fx_extension.cpp +++ b/core/src/fxcrt/fx_extension.cpp @@ -7,7 +7,6 @@ #include "../../include/fxcrt/fx_basic.h" #include "../../include/fxcrt/fx_ext.h" #include "extension.h" - #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ #include #else @@ -51,7 +50,9 @@ IFX_MemoryStream* FX_CreateMemoryStream(uint8_t* pBuffer, IFX_MemoryStream* FX_CreateMemoryStream(FX_BOOL bConsecutive) { return new CFX_MemoryStream(bConsecutive); } - +#ifdef __cplusplus +extern "C" { +#endif FX_FLOAT FXSYS_tan(FX_FLOAT a) { return (FX_FLOAT)tan(a); } @@ -188,7 +189,12 @@ FX_DWORD FX_HashCode_String_GetW(const FX_WCHAR* pStr, } return dwHashCode; } - +#ifdef __cplusplus +} +#endif +#ifdef __cplusplus +extern "C" { +#endif void* FX_Random_MT_Start(FX_DWORD dwSeed) { FX_LPMTRANDOMCONTEXT pContext = FX_Alloc(FX_MTRANDOMCONTEXT, 1); pContext->mt[0] = dwSeed; @@ -291,4 +297,6 @@ void FX_Random_GenerateCrypto(FX_DWORD* pBuffer, int32_t iCount) { FX_Random_GenerateBase(pBuffer, iCount); #endif } - +#ifdef __cplusplus +} +#endif -- cgit v1.2.3