aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackBoosY <47264268+JackBoosY@users.noreply.github.com>2019-03-29 05:46:21 +0800
committerPhil Christensen <philc@microsoft.com>2019-03-28 14:46:21 -0700
commit6e25f7e02ab2713a87d89ba6e55b00d683ce87a6 (patch)
treeb9d0078589c5299f8c595021a4bbf2afb653ad89
parent2665f91cd9efc8338d75b22ee8b9bba5fedd7992 (diff)
downloadvcpkg-6e25f7e02ab2713a87d89ba6e55b00d683ce87a6.tar.gz
vcpkg-6e25f7e02ab2713a87d89ba6e55b00d683ce87a6.zip
[giflib]fix compile error in x64-uwp (#5578)
* [giflib]fix compile error in x64-uwp * [giflib]Modify the location of the CMakelists.txt changes in the patch to avoid patching failures. * [giflib]Modify cmakelists.txt directly and delete the corresponding changes in the patch * [giflib] Modernize. Avoid use of WINDOWS_EXPORT_ALL_SYMBOLS.
-rw-r--r--ports/giflib/CMakeLists.txt1
-rw-r--r--ports/giflib/fix-compile-error.patch76
-rw-r--r--ports/giflib/portfile.cmake4
3 files changed, 80 insertions, 1 deletions
diff --git a/ports/giflib/CMakeLists.txt b/ports/giflib/CMakeLists.txt
index ae7d47447..a5b084ffc 100644
--- a/ports/giflib/CMakeLists.txt
+++ b/ports/giflib/CMakeLists.txt
@@ -17,6 +17,7 @@ set(GIFLIB_SOURCES
lib/quantize.c
)
+add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_library(gif ${GIFLIB_SOURCES})
if (NOT GIFLIB_SKIP_HEADERS)
diff --git a/ports/giflib/fix-compile-error.patch b/ports/giflib/fix-compile-error.patch
new file mode 100644
index 000000000..93cf467ff
--- /dev/null
+++ b/ports/giflib/fix-compile-error.patch
@@ -0,0 +1,76 @@
+diff --git a/lib/dgif_lib.c b/lib/dgif_lib.c
+index fddc0d2..7a6ab9c 100644
+--- a/lib/dgif_lib.c
++++ b/lib/dgif_lib.c
+@@ -54,7 +54,7 @@ DGifOpenFileName(const char *FileName, int *Error)
+ int FileHandle;
+ GifFileType *GifFile;
+
+- if ((FileHandle = open(FileName, O_RDONLY)) == -1) {
++ if ((FileHandle = _open(FileName, O_RDONLY)) == -1) {
+ if (Error != NULL)
+ *Error = D_GIF_ERR_OPEN_FAILED;
+ return NULL;
+@@ -81,7 +81,7 @@ DGifOpenFileHandle(int FileHandle, int *Error)
+ if (GifFile == NULL) {
+ if (Error != NULL)
+ *Error = D_GIF_ERR_NOT_ENOUGH_MEM;
+- (void)close(FileHandle);
++ (void)_close(FileHandle);
+ return NULL;
+ }
+
+@@ -95,7 +95,7 @@ DGifOpenFileHandle(int FileHandle, int *Error)
+ if (Private == NULL) {
+ if (Error != NULL)
+ *Error = D_GIF_ERR_NOT_ENOUGH_MEM;
+- (void)close(FileHandle);
++ (void)_close(FileHandle);
+ free((char *)GifFile);
+ return NULL;
+ }
+@@ -106,7 +106,7 @@ DGifOpenFileHandle(int FileHandle, int *Error)
+ _setmode(FileHandle, O_BINARY); /* Make sure it is in binary mode. */
+ #endif /* _WIN32 */
+
+- f = fdopen(FileHandle, "rb"); /* Make it into a stream: */
++ f = _fdopen(FileHandle, "rb"); /* Make it into a stream: */
+
+ /*@-mustfreeonly@*/
+ GifFile->Private = (void *)Private;
+diff --git a/lib/egif_lib.c b/lib/egif_lib.c
+index f30b61b..18dc4a2 100644
+--- a/lib/egif_lib.c
++++ b/lib/egif_lib.c
+@@ -60,10 +60,10 @@ EGifOpenFileName(const char *FileName, const bool TestExistence, int *Error)
+ GifFileType *GifFile;
+
+ if (TestExistence)
+- FileHandle = open(FileName, O_WRONLY | O_CREAT | O_EXCL,
++ FileHandle = _open(FileName, O_WRONLY | O_CREAT | O_EXCL,
+ S_IREAD | S_IWRITE);
+ else
+- FileHandle = open(FileName, O_WRONLY | O_CREAT | O_TRUNC,
++ FileHandle = _open(FileName, O_WRONLY | O_CREAT | O_TRUNC,
+ S_IREAD | S_IWRITE);
+
+ if (FileHandle == -1) {
+@@ -73,7 +73,7 @@ EGifOpenFileName(const char *FileName, const bool TestExistence, int *Error)
+ }
+ GifFile = EGifOpenFileHandle(FileHandle, Error);
+ if (GifFile == (GifFileType *) NULL)
+- (void)close(FileHandle);
++ (void)_close(FileHandle);
+ return GifFile;
+ }
+
+@@ -118,7 +118,7 @@ EGifOpenFileHandle(const int FileHandle, int *Error)
+ _setmode(FileHandle, O_BINARY); /* Make sure it is in binary mode. */
+ #endif /* _WIN32 */
+
+- f = fdopen(FileHandle, "wb"); /* Make it into a stream: */
++ f = _fdopen(FileHandle, "wb"); /* Make it into a stream: */
+
+ GifFile->Private = (void *)Private;
+ Private->FileHandle = FileHandle;
+
diff --git a/ports/giflib/portfile.cmake b/ports/giflib/portfile.cmake
index 1747ce3c2..86a7f9465 100644
--- a/ports/giflib/portfile.cmake
+++ b/ports/giflib/portfile.cmake
@@ -13,7 +13,9 @@ vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
REF ${GIFLIB_VERSION}
- PATCHES msvc-guard-unistd-h.patch
+ PATCHES
+ msvc-guard-unistd-h.patch
+ fix-compile-error.patch
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})