Files
MINGW-packages/mingw-w64-pdfium-git/pdfium-2729.patch
2016-05-09 11:01:51 -03:00

357 lines
12 KiB
Diff

diff -r -c pdfium.orig/build_gyp/gyp_pdfium pdfium/build_gyp/gyp_pdfium
*** pdfium.orig/build_gyp/gyp_pdfium 2016-05-09 10:47:41.000000000 -0300
--- pdfium/build_gyp/gyp_pdfium 2016-05-09 10:44:18.208997100 -0300
***************
*** 18,37 ****
sys.path.insert(0, os.path.join(pdfium_root, 'tools', 'gyp', 'pylib'))
import gyp
- # vs_toolchain needs to be after gyp path setting since it also uses gyp.
- sys.path.insert(0, os.path.join(pdfium_root, 'build'))
- import vs_toolchain
-
def run_gyp(args):
rc = gyp.main(args)
- # Copy Windows toolchain DLLs.
- vs_runtime_dll_dirs = vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs()
- if vs_runtime_dll_dirs:
- x64_runtime, x86_runtime = vs_runtime_dll_dirs
- vs_toolchain.CopyVsRuntimeDlls(
- os.path.join(pdfium_root, output_rel_dir), (x86_runtime, x64_runtime))
-
if rc != 0:
print 'Error running GYP'
sys.exit(rc)
--- 18,26 ----
***************
*** 58,66 ****
print 'GYP_GENERATORS is not set, defaulting to ninja'
os.environ['GYP_GENERATORS'] = 'ninja'
- # Set up the environment variables.
- vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs()
-
print 'Updating projects from gyp files...'
sys.stdout.flush()
--- 47,52 ----
diff -r -c pdfium.orig/core/fxcrt/fx_basic_util.cpp pdfium/core/fxcrt/fx_basic_util.cpp
*** pdfium.orig/core/fxcrt/fx_basic_util.cpp 2016-05-09 10:47:41.000000000 -0300
--- pdfium/core/fxcrt/fx_basic_util.cpp 2016-05-09 10:43:40.187642300 -0300
***************
*** 170,176 ****
return bNegative ? -value : value;
}
! #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900
void FXSYS_snprintf(char* str,
size_t size,
_Printf_format_string_ const char* fmt,
--- 170,176 ----
return bNegative ? -value : value;
}
! #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 && !defined(__MINGW32__)
void FXSYS_snprintf(char* str,
size_t size,
_Printf_format_string_ const char* fmt,
***************
*** 186,192 ****
str[size - 1] = 0;
}
}
! #endif // _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
class CFindFileData {
--- 186,192 ----
str[size - 1] = 0;
}
}
! #endif // _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 && !defined(__MINGW32__)
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
class CFindFileData {
diff -r -c pdfium.orig/core/fxcrt/include/fx_system.h pdfium/core/fxcrt/include/fx_system.h
*** pdfium.orig/core/fxcrt/include/fx_system.h 2016-05-09 10:47:41.000000000 -0300
--- pdfium/core/fxcrt/include/fx_system.h 2016-05-09 10:43:40.203267200 -0300
***************
*** 110,116 ****
// NOTE: prevent use of the return value from snprintf() since some platforms
// have different return values (e.g. windows _vsnprintf()), and provide
// versions that always NUL-terminate.
! #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900
void FXSYS_snprintf(char* str,
size_t size,
_Printf_format_string_ const char* fmt,
--- 110,116 ----
// NOTE: prevent use of the return value from snprintf() since some platforms
// have different return values (e.g. windows _vsnprintf()), and provide
// versions that always NUL-terminate.
! #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 && !defined(__MINGW32__)
void FXSYS_snprintf(char* str,
size_t size,
_Printf_format_string_ const char* fmt,
diff -r -c pdfium.orig/core/fxge/win32/fx_win32_dwrite.cpp pdfium/core/fxge/win32/fx_win32_dwrite.cpp
*** pdfium.orig/core/fxge/win32/fx_win32_dwrite.cpp 2016-05-09 10:47:42.000000000 -0300
--- pdfium/core/fxge/win32/fx_win32_dwrite.cpp 2016-05-09 10:43:40.218892400 -0300
***************
*** 12,17 ****
--- 12,23 ----
#include "core/fxge/include/fx_ge_win32.h"
#include "core/fxge/win32/dwrite_int.h"
+ #ifdef __MINGW32__
+ #define __in
+ #define __out
+ #define __in_opt
+ #endif
+
typedef HRESULT(__stdcall* FuncType_DWriteCreateFactory)(
__in DWRITE_FACTORY_TYPE,
__in REFIID,
diff -r -c pdfium.orig/core/fxge/win32/fx_win32_gdipext.cpp pdfium/core/fxge/win32/fx_win32_gdipext.cpp
*** pdfium.orig/core/fxge/win32/fx_win32_gdipext.cpp 2016-05-09 10:47:42.000000000 -0300
--- pdfium/core/fxge/win32/fx_win32_gdipext.cpp 2016-05-09 10:43:40.218892400 -0300
***************
*** 691,697 ****
return;
}
for (int i = 0; i < sizeof g_GdipFuncNames / sizeof(LPCSTR); i++) {
! m_Functions[i] = GetProcAddress(m_hModule, g_GdipFuncNames[i]);
if (!m_Functions[i]) {
m_hModule = NULL;
return;
--- 691,697 ----
return;
}
for (int i = 0; i < sizeof g_GdipFuncNames / sizeof(LPCSTR); i++) {
! m_Functions[i] = (void *)GetProcAddress(m_hModule, g_GdipFuncNames[i]);
if (!m_Functions[i]) {
m_hModule = NULL;
return;
***************
*** 706,714 ****
return;
}
m_pGdiAddFontMemResourceEx =
! GetProcAddress(m_GdiModule, "AddFontMemResourceEx");
m_pGdiRemoveFontMemResourseEx =
! GetProcAddress(m_GdiModule, "RemoveFontMemResourceEx");
}
CGdiplusExt::~CGdiplusExt() {}
LPVOID CGdiplusExt::LoadMemFont(LPBYTE pData, uint32_t size) {
--- 706,714 ----
return;
}
m_pGdiAddFontMemResourceEx =
! (void *)GetProcAddress(m_GdiModule, "AddFontMemResourceEx");
m_pGdiRemoveFontMemResourseEx =
! (void *)GetProcAddress(m_GdiModule, "RemoveFontMemResourceEx");
}
CGdiplusExt::~CGdiplusExt() {}
LPVOID CGdiplusExt::LoadMemFont(LPBYTE pData, uint32_t size) {
diff -r -c pdfium.orig/pdfium.gyp pdfium/pdfium.gyp
*** pdfium.orig/pdfium.gyp 2016-05-09 10:47:42.000000000 -0300
--- pdfium/pdfium.gyp 2016-05-09 10:43:40.218892400 -0300
***************
*** 106,112 ****
},
'targets': [
{
! 'target_name': 'pdfium',
'type': 'static_library',
'dependencies': [
'third_party/third_party.gyp:bigint',
--- 106,112 ----
},
'targets': [
{
! 'target_name': 'pdfium_static',
'type': 'static_library',
'dependencies': [
'third_party/third_party.gyp:bigint',
***************
*** 208,213 ****
--- 208,315 ----
},
},
{
+ 'target_name': 'pdfium',
+ 'type': 'shared_library',
+ 'dependencies': [
+ 'third_party/third_party.gyp:bigint',
+ 'third_party/third_party.gyp:pdfium_base',
+ 'fdrm',
+ 'fpdfdoc',
+ 'fpdfapi',
+ 'fpdftext',
+ 'formfiller',
+ 'fxcodec',
+ 'fxcrt',
+ 'fxedit',
+ 'fxge',
+ 'javascript',
+ 'pdfwindow',
+ ],
+ 'sources': [
+ 'fpdfsdk/cfx_systemhandler.cpp',
+ 'fpdfsdk/cfx_systemhandler.h',
+ 'fpdfsdk/include/fsdk_actionhandler.h',
+ 'fpdfsdk/include/fsdk_annothandler.h',
+ 'fpdfsdk/include/fsdk_baseannot.h',
+ 'fpdfsdk/include/fsdk_baseform.h',
+ 'fpdfsdk/fpdfdoc.cpp',
+ 'fpdfsdk/fpdfeditimg.cpp',
+ 'fpdfsdk/fpdfeditpage.cpp',
+ 'fpdfsdk/fpdfformfill.cpp',
+ 'fpdfsdk/fpdfppo.cpp',
+ 'fpdfsdk/fpdfsave.cpp',
+ 'fpdfsdk/fpdftext.cpp',
+ 'fpdfsdk/fpdfview.cpp',
+ 'fpdfsdk/fpdf_dataavail.cpp',
+ 'fpdfsdk/fpdf_ext.cpp',
+ 'fpdfsdk/fpdf_flatten.cpp',
+ 'fpdfsdk/fpdf_progressive.cpp',
+ 'fpdfsdk/fpdf_searchex.cpp',
+ 'fpdfsdk/fpdf_sysfontinfo.cpp',
+ 'fpdfsdk/fpdf_transformpage.cpp',
+ 'fpdfsdk/fsdk_actionhandler.cpp',
+ 'fpdfsdk/fsdk_annothandler.cpp',
+ 'fpdfsdk/fsdk_baseannot.cpp',
+ 'fpdfsdk/fsdk_baseform.cpp',
+ 'fpdfsdk/fsdk_mgr.cpp',
+ 'fpdfsdk/fsdk_rendercontext.cpp',
+ 'public/fpdf_dataavail.h',
+ 'public/fpdf_doc.h',
+ 'public/fpdf_edit.h',
+ 'public/fpdf_ext.h',
+ 'public/fpdf_flatten.h',
+ 'public/fpdf_formfill.h',
+ 'public/fpdf_fwlevent.h',
+ 'public/fpdf_ppo.h',
+ 'public/fpdf_progressive.h',
+ 'public/fpdf_save.h',
+ 'public/fpdf_searchex.h',
+ 'public/fpdf_sysfontinfo.h',
+ 'public/fpdf_text.h',
+ 'public/fpdf_transformpage.h',
+ 'public/fpdfview.h',
+ ],
+ 'conditions': [
+ ['pdf_enable_xfa==1', {
+ 'dependencies': [
+ 'fpdfxfa',
+ ],
+ }],
+ ['bundle_freetype==1', {
+ 'dependencies': [
+ 'third_party/third_party.gyp:fx_freetype',
+ ],
+ }, {
+ 'link_settings': {
+ 'libraries': [
+ '-lfreetype',
+ ],
+ },
+ }],
+ ],
+ 'all_dependent_settings': {
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'AdditionalDependencies': [
+ 'advapi32.lib',
+ 'gdi32.lib',
+ 'user32.lib',
+ ],
+ },
+ },
+ 'conditions': [
+ ['OS=="mac"', {
+ 'link_settings': {
+ 'libraries': [
+ '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
+ '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
+ ],
+ },
+ }],
+ ],
+ },
+ },
+ {
'target_name': 'fdrm',
'type': 'static_library',
'sources': [
***************
*** 912,918 ****
'dependencies': [
'<(DEPTH)/testing/gtest.gyp:gtest_main',
'<(DEPTH)/testing/gtest.gyp:gtest',
! 'pdfium',
'test_support',
],
'sources': [
--- 1014,1020 ----
'dependencies': [
'<(DEPTH)/testing/gtest.gyp:gtest_main',
'<(DEPTH)/testing/gtest.gyp:gtest',
! 'pdfium_static',
'test_support',
],
'sources': [
***************
*** 975,981 ****
'dependencies': [
'<(DEPTH)/testing/gmock.gyp:gmock',
'<(DEPTH)/testing/gtest.gyp:gtest',
! 'pdfium',
'test_support',
],
'sources': [
--- 1077,1083 ----
'dependencies': [
'<(DEPTH)/testing/gmock.gyp:gmock',
'<(DEPTH)/testing/gtest.gyp:gtest',
! 'pdfium_static',
'test_support',
],
'sources': [
diff -r -c pdfium.orig/samples/samples.gyp pdfium/samples/samples.gyp
*** pdfium.orig/samples/samples.gyp 2016-05-09 10:47:42.000000000 -0300
--- pdfium/samples/samples.gyp 2016-05-09 10:43:40.218892400 -0300
***************
*** 40,46 ****
'target_name': 'pdfium_test',
'type': 'executable',
'dependencies': [
! '../pdfium.gyp:pdfium',
'../pdfium.gyp:test_support',
# Regardless of whether the library ships against system freetype,
# always link this binary against the bundled one for consistency
--- 40,46 ----
'target_name': 'pdfium_test',
'type': 'executable',
'dependencies': [
! '../pdfium.gyp:pdfium_static',
'../pdfium.gyp:test_support',
# Regardless of whether the library ships against system freetype,
# always link this binary against the bundled one for consistency
***************
*** 80,86 ****
'type': 'executable',
'variables': { 'enable_wexit_time_destructors': 1, },
'dependencies': [
! '../pdfium.gyp:pdfium',
'../third_party/third_party.gyp:pdfium_base',
],
'sources': [
--- 80,86 ----
'type': 'executable',
'variables': { 'enable_wexit_time_destructors': 1, },
'dependencies': [
! '../pdfium.gyp:pdfium_static',
'../third_party/third_party.gyp:pdfium_base',
],
'sources': [