493 lines
18 KiB
Diff
493 lines
18 KiB
Diff
From 4764e6596fd56dd6e311c5e9aaa46b4ebc52ac26 Mon Sep 17 00:00:00 2001
|
|
From: "L. E. Segovia" <amy@amyspark.me>
|
|
Date: Fri, 26 Feb 2021 15:41:10 +0000
|
|
Subject: [PATCH] Add vcpkg CMake toolchain
|
|
|
|
---
|
|
CMakeLists.txt | 126 +++++++++++++++++++++++++++++++++++++++++++++++++
|
|
dgif_lib.c | 4 +-
|
|
egif_lib.c | 8 ++--
|
|
gif_font.c | 6 +++
|
|
gif_hash.h | 5 ++
|
|
gif_lib.h | 126 ++++++++++++++++++++++++++++---------------------
|
|
giftool.c | 2 +
|
|
7 files changed, 216 insertions(+), 61 deletions(-)
|
|
create mode 100644 CMakeLists.txt
|
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
new file mode 100644
|
|
index 0000000..a7ac238
|
|
--- /dev/null
|
|
+++ b/CMakeLists.txt
|
|
@@ -0,0 +1,126 @@
|
|
+# SPDX-FileCopyrightText: 2010,2013 Patrick Spendrin <ps_ml@gmx.de>
|
|
+# SPDX-FileCopyrightText: 2019 Ivan Yossi <ghevan@gmail.com>
|
|
+# SPDX-FileCopyrightText: 2021 L. E. Segovia <amy@amyspark.me>
|
|
+#
|
|
+# SPDX-License-Identifier: BSD-2-Clause
|
|
+
|
|
+cmake_minimum_required(VERSION 3.29)
|
|
+
|
|
+project(giflib LANGUAGES C VERSION 5.2.1)
|
|
+
|
|
+if (APPLE)
|
|
+ set(APPLE_SUPPRESS_X11_WARNING TRUE)
|
|
+ set(CMAKE_MACOSX_RPATH 1)
|
|
+ set(BUILD_WITH_INSTALL_RPATH 1)
|
|
+ add_definitions(-mmacosx-version-min=$ENV{MACOSX_DEPLOYMENT_TARGET} -Wno-macro-redefined -Wno-deprecated-register)
|
|
+endif()
|
|
+
|
|
+option(BUILD_utils "build also some small helper executables to transform gif files into other formats" OFF)
|
|
+option(BUILD_TESTS "build some unittest files" OFF)
|
|
+
|
|
+include(CheckIncludeFile)
|
|
+
|
|
+check_include_file("fcntl.h" HAVE_FCNTL_H)
|
|
+check_include_file("io.h" HAVE_IO_H)
|
|
+check_include_file("stdarg.h" HAVE_STDARG_H)
|
|
+check_include_file("inttypes.h" HAVE_INTTYPES_H)
|
|
+check_include_file("limits.h" HAVE_MEMORY_H)
|
|
+check_include_file("memory.h" HAVE_MEMORY_H)
|
|
+check_include_file("stdint.h" HAVE_STDINT_H)
|
|
+check_include_file("stdlib.h" HAVE_STDLIB_H)
|
|
+check_include_file("strings.h" HAVE_STRINGS_H)
|
|
+check_include_file("string.h" HAVE_STRING_H)
|
|
+check_include_file("sys/stat.h" HAVE_SYS_STAT_H)
|
|
+check_include_file("sys/types.h" HAVE_SYS_TYPES_H)
|
|
+check_include_file("unistd.h" HAVE_UNISTD_H)
|
|
+
|
|
+include(CheckSymbolExists)
|
|
+check_symbol_exists(strtok_r string.h HAVE_STRTOK_R)
|
|
+
|
|
+add_definitions(-DHAVE_CONFIG_H)
|
|
+if(MSVC)
|
|
+ add_definitions(-D_CRT_SECURE_NO_WARNINGS -wd4996)
|
|
+endif(MSVC)
|
|
+
|
|
+set(GIFLIB_HEADERS
|
|
+ gif_lib.h
|
|
+)
|
|
+
|
|
+set(GIFLIB_SOURCES
|
|
+ dgif_lib.c
|
|
+ egif_lib.c
|
|
+ gif_err.c
|
|
+ gif_font.c
|
|
+ gif_hash.c
|
|
+ gifalloc.c
|
|
+ openbsd-reallocarray.c
|
|
+ quantize.c
|
|
+)
|
|
+
|
|
+set(libgif_USSRCS
|
|
+ gif_err.c
|
|
+ quantize.c
|
|
+ qprintf.c
|
|
+ getarg.c
|
|
+ )
|
|
+
|
|
+add_library(gif SHARED ${GIFLIB_SOURCES})
|
|
+
|
|
+if(ANDROID)
|
|
+ add_definitions (-DSIZE_MAX=0xffffffff -DS_IREAD=S_IRUSR -DS_IWRITE=S_IWUSR -DS_IEXEC=S_IXUSR)
|
|
+endif(ANDROID)
|
|
+
|
|
+if (NOT GIFLIB_SKIP_HEADERS)
|
|
+ install(FILES ${GIFLIB_HEADERS} DESTINATION include)
|
|
+endif ()
|
|
+
|
|
+install(TARGETS gif
|
|
+ RUNTIME DESTINATION bin
|
|
+ LIBRARY DESTINATION lib
|
|
+ ARCHIVE DESTINATION lib
|
|
+)
|
|
+
|
|
+if(BUILD_utils)
|
|
+ add_library(util STATIC ${libgif_USSRCS})
|
|
+
|
|
+macro(compileUtils)
|
|
+foreach(srcfile ${ARGN})
|
|
+ add_executable(${srcfile} ${srcfile}.c)
|
|
+ target_link_libraries(${srcfile} gif util)
|
|
+ install(TARGETS ${srcfile} RUNTIME DESTINATION bin
|
|
+ LIBRARY DESTINATION lib
|
|
+ ARCHIVE DESTINATION lib)
|
|
+endforeach(srcfile ${ARGN})
|
|
+endmacro(compileUtils)
|
|
+
|
|
+compileUtils(
|
|
+ gif2rgb
|
|
+ gifbuild
|
|
+ giffix
|
|
+ giftext
|
|
+ giftool
|
|
+ gifclrmp
|
|
+ gifbg
|
|
+ gifcolor
|
|
+ giffilter
|
|
+ gifhisto
|
|
+ gifinto
|
|
+ gifsponge
|
|
+ gifwedge
|
|
+)
|
|
+
|
|
+if(BUILD_TESTS)
|
|
+ foreach(srcfile gifbg gifcolor giffilter gifhisto gifsponge gifwedge)
|
|
+ add_executable(${srcfile} ${srcfile}.c)
|
|
+ target_link_libraries(${srcfile} gif util)
|
|
+ endforeach(srcfile gifbg gifcolor giffilter gifhisto gifsponge gifwedge)
|
|
+endif(BUILD_TESTS)
|
|
+
|
|
+if(NOT WIN32)
|
|
+ target_link_libraries(gifclrmp m)
|
|
+endif(NOT WIN32)
|
|
+
|
|
+endif(BUILD_utils)
|
|
+
|
|
+# documentation
|
|
+#add_subdirectory(doc)
|
|
diff --git a/dgif_lib.c b/dgif_lib.c
|
|
index 82fc097..b624a50 100644
|
|
--- a/dgif_lib.c
|
|
+++ b/dgif_lib.c
|
|
@@ -17,11 +17,11 @@ SPDX-License-Identifier: MIT
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
-#ifdef _WIN32
|
|
+#ifdef _MSC_VER
|
|
#include <io.h>
|
|
#else
|
|
#include <unistd.h>
|
|
-#endif /* _WIN32 */
|
|
+#endif /* _MSC_VER */
|
|
|
|
#include "gif_lib.h"
|
|
#include "gif_lib_private.h"
|
|
diff --git a/egif_lib.c b/egif_lib.c
|
|
index 6219af0..1bc1493 100644
|
|
--- a/egif_lib.c
|
|
+++ b/egif_lib.c
|
|
@@ -16,12 +16,12 @@ SPDX-License-Identifier: MIT
|
|
#include <string.h>
|
|
#include <fcntl.h>
|
|
|
|
-#ifdef _WIN32
|
|
+#ifdef _MSC_VER
|
|
#include <io.h>
|
|
#else
|
|
#include <unistd.h>
|
|
#include <sys/types.h>
|
|
-#endif /* _WIN32 */
|
|
+#endif /* _MSC_VER */
|
|
#include <sys/stat.h>
|
|
|
|
#include "gif_lib.h"
|
|
@@ -37,8 +37,8 @@ static const GifPixelType CodeMask[] = {
|
|
static int EGifPutWord(int Word, GifFileType * GifFile);
|
|
static int EGifSetupCompress(GifFileType * GifFile);
|
|
static int EGifCompressLine(GifFileType * GifFile, GifPixelType * Line,
|
|
- int LineLen);
|
|
-static int EGifCompressOutput(GifFileType * GifFile, int Code);
|
|
+ const int LineLen);
|
|
+static int EGifCompressOutput(GifFileType * GifFile, const int Code);
|
|
static int EGifBufferedOutput(GifFileType * GifFile, GifByteType * Buf,
|
|
int c);
|
|
|
|
diff --git a/gif_font.c b/gif_font.c
|
|
index d90783c..a31ad40 100644
|
|
--- a/gif_font.c
|
|
+++ b/gif_font.c
|
|
@@ -9,6 +9,12 @@ SPDX-License-Identifier: MIT
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
|
|
+#ifdef _WIN32
|
|
+#ifndef HAVE_STRTOK_R
|
|
+#define strtok_r strtok_s
|
|
+#endif
|
|
+#endif
|
|
+
|
|
#include "gif_lib.h"
|
|
|
|
/*****************************************************************************
|
|
diff --git a/gif_hash.h b/gif_hash.h
|
|
index 6a1b585..d11576d 100644
|
|
--- a/gif_hash.h
|
|
+++ b/gif_hash.h
|
|
@@ -9,7 +9,12 @@ SPDX-License-Identifier: MIT
|
|
#ifndef _GIF_HASH_H_
|
|
#define _GIF_HASH_H_
|
|
|
|
+#ifdef _MSC_VER
|
|
+#include <io.h>
|
|
+#else
|
|
+#include <sys/types.h>
|
|
#include <unistd.h>
|
|
+#endif /* _MSC_VER */
|
|
#include <stdint.h>
|
|
|
|
#define HT_SIZE 8192 /* 12bits = 4096 or twice as big! */
|
|
diff --git a/gif_lib.h b/gif_lib.h
|
|
index ebdbd3c..aa3a844 100644
|
|
--- a/gif_lib.h
|
|
+++ b/gif_lib.h
|
|
@@ -11,6 +11,10 @@ SPDX-License-Identifier: MIT
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
+#elif !defined(_STDBOOL_H)
|
|
+#include <stdbool.h>
|
|
+#else
|
|
+//typedef int bool;
|
|
#endif /* __cplusplus */
|
|
|
|
#define GIFLIB_MAJOR 5
|
|
@@ -21,7 +25,6 @@ extern "C" {
|
|
#define GIF_OK 1
|
|
|
|
#include <stddef.h>
|
|
-#include <stdbool.h>
|
|
|
|
#define GIF_STAMP "GIFVER" /* First chars in file - GIF stamp. */
|
|
#define GIF_STAMP_LEN sizeof(GIF_STAMP) - 1
|
|
@@ -120,18 +123,31 @@ typedef struct GraphicsControlBlock {
|
|
#define NO_TRANSPARENT_COLOR -1
|
|
} GraphicsControlBlock;
|
|
|
|
+/******************************************************************************
|
|
+ Windows exports
|
|
+******************************************************************************/
|
|
+#if !defined(gif_STATIC) && defined(_WIN32) || defined(_WIN64)
|
|
+# ifdef gif_EXPORTS
|
|
+# define GIF_EXPORT __declspec(dllexport)
|
|
+# else
|
|
+# define GIF_EXPORT __declspec(dllimport)
|
|
+# endif
|
|
+#else
|
|
+# define GIF_EXPORT
|
|
+#endif
|
|
+
|
|
/******************************************************************************
|
|
GIF encoding routines
|
|
******************************************************************************/
|
|
|
|
/* Main entry points */
|
|
-GifFileType *EGifOpenFileName(const char *GifFileName,
|
|
+GIF_EXPORT GifFileType *EGifOpenFileName(const char *GifFileName,
|
|
const bool GifTestExistence, int *Error);
|
|
-GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error);
|
|
-GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error);
|
|
-int EGifSpew(GifFileType * GifFile);
|
|
-const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */
|
|
-int EGifCloseFile(GifFileType *GifFile, int *ErrorCode);
|
|
+GIF_EXPORT GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error);
|
|
+GIF_EXPORT GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error);
|
|
+GIF_EXPORT int EGifSpew(GifFileType * GifFile);
|
|
+GIF_EXPORT const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */
|
|
+GIF_EXPORT int EGifCloseFile(GifFileType *GifFile, int *ErrorCode);
|
|
|
|
#define E_GIF_SUCCEEDED 0
|
|
#define E_GIF_ERR_OPEN_FAILED 1 /* And EGif possible errors. */
|
|
@@ -146,31 +162,31 @@ int EGifCloseFile(GifFileType *GifFile, int *ErrorCode);
|
|
#define E_GIF_ERR_NOT_WRITEABLE 10
|
|
|
|
/* These are legacy. You probably do not want to call them directly */
|
|
-int EGifPutScreenDesc(GifFileType *GifFile,
|
|
+GIF_EXPORT int EGifPutScreenDesc(GifFileType *GifFile,
|
|
const int GifWidth, const int GifHeight,
|
|
const int GifColorRes,
|
|
const int GifBackGround,
|
|
const ColorMapObject *GifColorMap);
|
|
-int EGifPutImageDesc(GifFileType *GifFile,
|
|
+GIF_EXPORT int EGifPutImageDesc(GifFileType *GifFile,
|
|
const int GifLeft, const int GifTop,
|
|
const int GifWidth, const int GifHeight,
|
|
const bool GifInterlace,
|
|
const ColorMapObject *GifColorMap);
|
|
-void EGifSetGifVersion(GifFileType *GifFile, const bool gif89);
|
|
-int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine,
|
|
+GIF_EXPORT void EGifSetGifVersion(GifFileType *GifFile, const bool gif89);
|
|
+GIF_EXPORT int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine,
|
|
int GifLineLen);
|
|
-int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel);
|
|
-int EGifPutComment(GifFileType *GifFile, const char *GifComment);
|
|
-int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode);
|
|
-int EGifPutExtensionBlock(GifFileType *GifFile,
|
|
+GIF_EXPORT int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel);
|
|
+GIF_EXPORT int EGifPutComment(GifFileType *GifFile, const char *GifComment);
|
|
+GIF_EXPORT int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode);
|
|
+GIF_EXPORT int EGifPutExtensionBlock(GifFileType *GifFile,
|
|
const int GifExtLen, const void *GifExtension);
|
|
-int EGifPutExtensionTrailer(GifFileType *GifFile);
|
|
-int EGifPutExtension(GifFileType *GifFile, const int GifExtCode,
|
|
+GIF_EXPORT int EGifPutExtensionTrailer(GifFileType *GifFile);
|
|
+GIF_EXPORT int EGifPutExtension(GifFileType *GifFile, const int GifExtCode,
|
|
const int GifExtLen,
|
|
const void *GifExtension);
|
|
-int EGifPutCode(GifFileType *GifFile, int GifCodeSize,
|
|
+GIF_EXPORT int EGifPutCode(GifFileType *GifFile, int GifCodeSize,
|
|
const GifByteType *GifCodeBlock);
|
|
-int EGifPutCodeNext(GifFileType *GifFile,
|
|
+GIF_EXPORT int EGifPutCodeNext(GifFileType *GifFile,
|
|
const GifByteType *GifCodeBlock);
|
|
|
|
/******************************************************************************
|
|
@@ -178,11 +194,11 @@ int EGifPutCodeNext(GifFileType *GifFile,
|
|
******************************************************************************/
|
|
|
|
/* Main entry points */
|
|
-GifFileType *DGifOpenFileName(const char *GifFileName, int *Error);
|
|
-GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error);
|
|
-int DGifSlurp(GifFileType * GifFile);
|
|
-GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new one (TVT) */
|
|
- int DGifCloseFile(GifFileType * GifFile, int *ErrorCode);
|
|
+GIF_EXPORT GifFileType *DGifOpenFileName(const char *GifFileName, int *Error);
|
|
+GIF_EXPORT GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error);
|
|
+GIF_EXPORT int DGifSlurp(GifFileType * GifFile);
|
|
+GIF_EXPORT GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new one (TVT) */
|
|
+ GIF_EXPORT int DGifCloseFile(GifFileType * GifFile, int *ErrorCode);
|
|
|
|
#define D_GIF_SUCCEEDED 0
|
|
#define D_GIF_ERR_OPEN_FAILED 101 /* And DGif possible errors. */
|
|
@@ -200,26 +216,26 @@ GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new
|
|
#define D_GIF_ERR_EOF_TOO_SOON 113
|
|
|
|
/* These are legacy. You probably do not want to call them directly */
|
|
-int DGifGetScreenDesc(GifFileType *GifFile);
|
|
-int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType);
|
|
-int DGifGetImageHeader(GifFileType *GifFile);
|
|
-int DGifGetImageDesc(GifFileType *GifFile);
|
|
-int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen);
|
|
-int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel);
|
|
-int DGifGetExtension(GifFileType *GifFile, int *GifExtCode,
|
|
+GIF_EXPORT int DGifGetScreenDesc(GifFileType *GifFile);
|
|
+GIF_EXPORT int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType);
|
|
+GIF_EXPORT int DGifGetImageHeader(GifFileType *GifFile);
|
|
+GIF_EXPORT int DGifGetImageDesc(GifFileType *GifFile);
|
|
+GIF_EXPORT int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen);
|
|
+GIF_EXPORT int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel);
|
|
+GIF_EXPORT int DGifGetExtension(GifFileType *GifFile, int *GifExtCode,
|
|
GifByteType **GifExtension);
|
|
-int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension);
|
|
-int DGifGetCode(GifFileType *GifFile, int *GifCodeSize,
|
|
+GIF_EXPORT int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension);
|
|
+GIF_EXPORT int DGifGetCode(GifFileType *GifFile, int *GifCodeSize,
|
|
GifByteType **GifCodeBlock);
|
|
-int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock);
|
|
-int DGifGetLZCodes(GifFileType *GifFile, int *GifCode);
|
|
-const char *DGifGetGifVersion(GifFileType *GifFile);
|
|
+GIF_EXPORT int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock);
|
|
+GIF_EXPORT int DGifGetLZCodes(GifFileType *GifFile, int *GifCode);
|
|
+GIF_EXPORT const char *DGifGetGifVersion(GifFileType *GifFile);
|
|
|
|
|
|
/******************************************************************************
|
|
Error handling and reporting.
|
|
******************************************************************************/
|
|
-extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */
|
|
+GIF_EXPORT extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */
|
|
|
|
/*****************************************************************************
|
|
Everything below this point is new after version 1.2, supporting `slurp
|
|
@@ -230,43 +246,43 @@ extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */
|
|
Color map handling from gif_alloc.c
|
|
******************************************************************************/
|
|
|
|
-extern ColorMapObject *GifMakeMapObject(int ColorCount,
|
|
+GIF_EXPORT extern ColorMapObject *GifMakeMapObject(int ColorCount,
|
|
const GifColorType *ColorMap);
|
|
-extern void GifFreeMapObject(ColorMapObject *Object);
|
|
-extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1,
|
|
+GIF_EXPORT extern void GifFreeMapObject(ColorMapObject *Object);
|
|
+GIF_EXPORT extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1,
|
|
const ColorMapObject *ColorIn2,
|
|
GifPixelType ColorTransIn2[]);
|
|
-extern int GifBitSize(int n);
|
|
+GIF_EXPORT extern int GifBitSize(int n);
|
|
|
|
/******************************************************************************
|
|
Support for the in-core structures allocation (slurp mode).
|
|
******************************************************************************/
|
|
|
|
-extern void GifApplyTranslation(SavedImage *Image, GifPixelType Translation[]);
|
|
-extern int GifAddExtensionBlock(int *ExtensionBlock_Count,
|
|
+GIF_EXPORT extern void GifApplyTranslation(SavedImage *Image, GifPixelType Translation[]);
|
|
+GIF_EXPORT extern int GifAddExtensionBlock(int *ExtensionBlock_Count,
|
|
ExtensionBlock **ExtensionBlocks,
|
|
int Function,
|
|
unsigned int Len, unsigned char ExtData[]);
|
|
-extern void GifFreeExtensions(int *ExtensionBlock_Count,
|
|
+GIF_EXPORT extern void GifFreeExtensions(int *ExtensionBlock_Count,
|
|
ExtensionBlock **ExtensionBlocks);
|
|
-extern SavedImage *GifMakeSavedImage(GifFileType *GifFile,
|
|
+GIF_EXPORT extern SavedImage *GifMakeSavedImage(GifFileType *GifFile,
|
|
const SavedImage *CopyFrom);
|
|
-extern void GifFreeSavedImages(GifFileType *GifFile);
|
|
+GIF_EXPORT extern void GifFreeSavedImages(GifFileType *GifFile);
|
|
|
|
/******************************************************************************
|
|
5.x functions for GIF89 graphics control blocks
|
|
******************************************************************************/
|
|
|
|
-int DGifExtensionToGCB(const size_t GifExtensionLength,
|
|
+GIF_EXPORT int DGifExtensionToGCB(const size_t GifExtensionLength,
|
|
const GifByteType *GifExtension,
|
|
GraphicsControlBlock *GCB);
|
|
-size_t EGifGCBToExtension(const GraphicsControlBlock *GCB,
|
|
+GIF_EXPORT size_t EGifGCBToExtension(const GraphicsControlBlock *GCB,
|
|
GifByteType *GifExtension);
|
|
|
|
-int DGifSavedExtensionToGCB(GifFileType *GifFile,
|
|
+GIF_EXPORT int DGifSavedExtensionToGCB(GifFileType *GifFile,
|
|
int ImageIndex,
|
|
GraphicsControlBlock *GCB);
|
|
-int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB,
|
|
+GIF_EXPORT int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB,
|
|
GifFileType *GifFile,
|
|
int ImageIndex);
|
|
|
|
@@ -276,21 +292,21 @@ int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB,
|
|
|
|
#define GIF_FONT_WIDTH 8
|
|
#define GIF_FONT_HEIGHT 8
|
|
-extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH];
|
|
+GIF_EXPORT extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH];
|
|
|
|
-extern void GifDrawText8x8(SavedImage *Image,
|
|
+GIF_EXPORT extern void GifDrawText8x8(SavedImage *Image,
|
|
const int x, const int y,
|
|
const char *legend, const int color);
|
|
|
|
-extern void GifDrawBox(SavedImage *Image,
|
|
+GIF_EXPORT extern void GifDrawBox(SavedImage *Image,
|
|
const int x, const int y,
|
|
const int w, const int d, const int color);
|
|
|
|
-extern void GifDrawRectangle(SavedImage *Image,
|
|
+GIF_EXPORT extern void GifDrawRectangle(SavedImage *Image,
|
|
const int x, const int y,
|
|
const int w, const int d, const int color);
|
|
|
|
-extern void GifDrawBoxedText8x8(SavedImage *Image,
|
|
+GIF_EXPORT extern void GifDrawBoxedText8x8(SavedImage *Image,
|
|
const int x, const int y,
|
|
const char *legend,
|
|
const int border, const int bg, const int fg);
|
|
diff --git a/giftool.c b/giftool.c
|
|
index 77c75c0..a96cf27 100644
|
|
--- a/giftool.c
|
|
+++ b/giftool.c
|
|
@@ -12,7 +12,9 @@ SPDX-License-Identifier: MIT
|
|
#include <fcntl.h>
|
|
#include <stdbool.h>
|
|
|
|
+#ifndef _WIN32
|
|
#include "getopt.h"
|
|
+#endif
|
|
#include "gif_lib.h"
|
|
#include "getarg.h"
|
|
|
|
--
|
|
2.54.0
|
|
|