Skip to content

Commit ffcce44

Browse files
authored
Update FLTK to 1.4.4 (#87)
1 parent 69b1d9a commit ffcce44

23 files changed

+925
-652
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,23 @@ jobs:
1414

1515
- name: Install dependencies
1616
run: |
17-
sudo apt-get install -y git zlib1g-dev libpng-dev libxpm-dev libx11-dev libxft-dev libxinerama-dev libfontconfig1-dev x11proto-xext-dev libxrender-dev libxfixes-dev
17+
sudo apt-get install -y git zlib1g-dev libpng-dev libxpm-dev libx11-dev libxft-dev libxinerama-dev libfontconfig1-dev x11proto-xext-dev libxrender-dev libxfixes-dev libcairo2-dev libpango1.0-dev
1818
1919
- name: Checkout FLTK
2020
uses: actions/checkout@master
2121
with:
22-
path: fltk
22+
path: lib/fltk
2323
repository: fltk/fltk
24-
ref: release-1.3.7
24+
ref: release-1.4.4
2525
fetch-depth: 1
2626

2727
- name: Install FLTK
28-
working-directory: fltk
28+
working-directory: lib/fltk
2929
run: |
30-
./autogen.sh --prefix="$PWD/.." --with-abiversion=10307
30+
cmake -D CMAKE_INSTALL_PREFIX="$(realpath "$PWD/../..")" -D CMAKE_BUILD_TYPE=Release -D FLTK_GRAPHICS_CAIRO=1 -D FLTK_BACKEND_WAYLAND=0 -D FLTK_USE_SYSTEM_LIBPNG=0 -D FLTK_USE_SYSTEM_ZLIB=0 -D FLTK_BUILD_GL=0 -D FLTK_BUILD_TEST=0
3131
make
3232
make install
3333
3434
- name: Build
3535
run: |
36-
export PATH="$PWD/bin:$PATH"
3736
make

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ bin/
33
lib/
44
share/
55
tmp/
6-
fltk/
76

87
# no FL includes
98
include/FL/

INSTALL.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ If the pre-built release already works for you, you don't have to build it yours
1818
1. On GitHub, click the green "**Code**" button and click "**Download ZIP**". This will download **tilemap-studio-master.zip**.
1919
2. Unzip tilemap-studio-master.zip. This will create the **tilemap-studio-master** folder.
2020
3. Navigate to the tilemap-studio-master folder in Explorer.
21-
4. Download fltk-1.3.7-source.tar.bz2 or fltk-1.3.7-source.tar.gz from [**fltk.org**](https://www.fltk.org/software.php) to a new **tilemap-studio-master\lib** subfolder.
22-
5. Extract fltk-1.3.7-source.tar (you may need a program such as [7-Zip](https://www.7-zip.org/)). This will create the lib\**fltk-1.3.7** folder.
23-
6. Open lib\fltk-1.3.7\abi-version.ide in a text editor such as Notepad and replace "`#undef FL_ABI_VERSION`" with "`#define FL_ABI_VERSION 10307`". Save it.
24-
7. Open lib\fltk-1.3.7\ide\VisualC2010\fltk.sln in Visual Studio 2019. (Other versions may or may not work, I haven't tried.)
25-
8. A "Retarget Projects" dialog will open, since fltk.sln was made for Visual Studio 2010. Click OK to upgrade the Windows SDK version and platform toolset.
26-
9. Go to **Build → Batch Build…**, check the projects **fltk**, **fltkimages**, **fltkpng**, **fltkjpeg**, and **fltkzlib** in the Release configuration, and click the **Build** button.
27-
10. Move all the .lib files from lib\fltk-1.3.7\lib\\\*.lib up to lib\\\*.lib.
28-
11. Copy the lib\FL folder up to include\FL.
21+
4. Download fltk-1.4.4-source.tar.bz2 or fltk-1.4.4-source.tar.gz from [**fltk.org**](https://www.fltk.org/software.php) to a new **tilemap-studio-master\lib** subfolder.
22+
5. Extract fltk-1.4.4-source.tar (you may need a program such as [7-Zip](https://www.7-zip.org/)). This will create the lib\\**fltk-1.4.4** folder.
23+
6. Open Visual Studio, select **Open a local folder**, and open the lib\fltk-1.4.4 folder. This will automatically generate the CMake project with a configuration named **x64-Debug** by default.
24+
7. From the Configuration dropdown, select **Manage Configurations...**, click the green plus sign to add a new configuration, and select **x86-Release** from the list. Set the **Configuration type** to **Release**, set the **Toolset** to **msvc_x86_x64**, and uncheck the **FLTK_GRAPHICS_GDIPLUS** option in the list of CMake variables.
25+
8. Set the active Configuration to **x86-Release**.
26+
9. In the **Solution Explorer**, switch to the **CMake Targets View**, right-click on **fltk_images**, and select **Build fltk_images**. This will also build the other required libraries: fltk, fltk_png, and fltk_z.
27+
10. Move all the .lib files from lib\fltk-1.4.4\out\build\x86-Release\lib\\\*.lib up to lib\\\*.lib.
28+
11. Copy the lib\fltk-1.4.4\\**FL** folder to a new include\\**FL** folder. Also copy lib\fltk-1.4.4\out\build\x86-Release\FL\fl_config.h into include\FL.
2929
12. Open ide\tilemap-studio.sln in Visual Studio 2019.
3030
13. If the Solution Configuration dropdown on the toolbar says Debug, set it to **Release**.
31-
14. Go to **Build → Build Solution** or press F7 to build the project. This will create bin\Release\**tilemapstudio.exe**.
31+
14. Go to **Build → Build Solution** or press F7 to build the project. This will create bin\Release\\**tilemapstudio.exe**.
3232
15. Hold down Shift, right-click **install.bat**, and click "**Run as administrator**". This will install Tilemap Studio to your account and create a shortcut on your Desktop.
3333

3434

@@ -38,13 +38,15 @@ If the pre-built release already works for you, you don't have to build it yours
3838

3939
You need at least g++ 7 for C++17 support.
4040

41+
CMake (version 3.15 or later) is required for building FLTK 1.4.
42+
4143
#### Ubuntu/Debian
4244

4345
Run the following commands:
4446

4547
```bash
4648
sudo apt install make g++ git autoconf
47-
sudo apt install zlib1g-dev libpng-dev libxpm-dev libx11-dev libxft-dev libxinerama-dev libfontconfig1-dev x11proto-xext-dev libxrender-dev libxfixes-dev
49+
sudo apt install zlib1g-dev libpng-dev libxpm-dev libx11-dev libxft-dev libxinerama-dev libfontconfig1-dev x11proto-xext-dev libxrender-dev libxfixes-dev libcairo2-dev libpango1.0-dev
4850
```
4951

5052
#### Fedora
@@ -53,7 +55,7 @@ Run the following commands:
5355

5456
```bash
5557
sudo dnf install make g++ git autoconf
56-
sudo dnf install zlib-devel libpng-devel libXpm-devel libX11-devel libXft-devel libXinerama-devel fontconfig-devel libXext-devel libXrender-devel libXfixes-devel
58+
sudo dnf install zlib-devel libpng-devel libXpm-devel libX11-devel libXft-devel libXinerama-devel fontconfig-devel libXext-devel libXrender-devel libXfixes-devel libcairo2-devel libpango1.0-devel
5759
```
5860

5961
### Install and build Tilemap Studio
@@ -65,18 +67,15 @@ Run the following commands:
6567
git clone https://github.com/Rangi42/tilemap-studio.git
6668
cd tilemap-studio
6769

68-
# Build FLTK 1.3.7 with the latest ABI enabled
69-
# (even if you already have libfltk1.3-dev installed)
70-
git clone --branch release-1.3.7 --depth 1 https://github.com/fltk/fltk.git
71-
pushd fltk
72-
./autogen.sh --prefix="$PWD/.." --with-abiversion=10307
70+
# Build FLTK 1.4.4
71+
git clone --branch release-1.4.4 --depth 1 https://github.com/fltk/fltk.git lib/fltk
72+
pushd lib/fltk
73+
cmake -D CMAKE_INSTALL_PREFIX="$(realpath "$PWD/../..")" -D CMAKE_BUILD_TYPE=Release -D FLTK_GRAPHICS_CAIRO=1 -D FLTK_BACKEND_WAYLAND=0 -D FLTK_USE_SYSTEM_LIBPNG=0 -D FLTK_USE_SYSTEM_ZLIB=0
7374
make
7475
make install
7576
popd
7677

7778
# Build Tilemap Studio
78-
# ("export PATH" is needed if bin/fltk-config is not already in your PATH)
79-
export PATH="$PWD/bin:$PATH"
8079
make
8180

8281
# Install Tilemap Studio

Makefile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ tmpdir = tmp
1414
debugdir = tmp/debug
1515
bindir = bin
1616

17-
CXXFLAGS = -std=c++17 -I$(srcdir) -I$(resdir) $(shell fltk-config --use-images --cxxflags)
18-
LDFLAGS = $(shell fltk-config --use-images --ldflags) $(shell pkg-config --libs libpng xpm)
17+
fltk-config = $(bindir)/fltk-config
1918

20-
RELEASEFLAGS = -DNDEBUG -O3 -flto -march=native
19+
CXXFLAGS := -std=c++17 -I$(srcdir) -I$(resdir) $(shell $(fltk-config) --use-images --cxxflags) $(CXXFLAGS)
20+
LDFLAGS := $(shell $(fltk-config) --use-images --ldstaticflags) $(shell pkg-config --libs xpm) $(LDFLAGS)
21+
22+
RELEASEFLAGS = -DNDEBUG -O3 -flto
2123
DEBUGFLAGS = -DDEBUG -D_DEBUG -O0 -g -ggdb3 -Wall -Wextra -pedantic -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter
2224

23-
COMMON = $(wildcard $(srcdir)/*.h) $(wildcard $(resdir)/*.xpm)
25+
COMMON = $(wildcard $(srcdir)/*.h) $(wildcard $(resdir)/*.xpm) $(resdir)/help.html
2426
SOURCES = $(wildcard $(srcdir)/*.cpp)
2527
OBJECTS = $(SOURCES:$(srcdir)/%.cpp=$(tmpdir)/%.o)
2628
DEBUGOBJECTS = $(SOURCES:$(srcdir)/%.cpp=$(debugdir)/%.o)
@@ -37,19 +39,19 @@ all: $(tilemapstudio)
3739
$(tilemapstudio): release
3840
$(tilemapstudiod): debug
3941

40-
release: CXXFLAGS += $(RELEASEFLAGS)
42+
release: CXXFLAGS := $(RELEASEFLAGS) $(CXXFLAGS)
4143
release: $(TARGET)
4244

43-
debug: CXXFLAGS += $(DEBUGFLAGS)
45+
debug: CXXFLAGS := $(DEBUGFLAGS) $(CXXFLAGS)
4446
debug: $(DEBUGTARGET)
4547

4648
$(TARGET): $(OBJECTS)
4749
@mkdir -p $(@D)
48-
$(LD) -o $@ $^ $(LDFLAGS)
50+
$(LD) -o $@ $^ $(CXXFLAGS) $(LDFLAGS)
4951

5052
$(DEBUGTARGET): $(DEBUGOBJECTS)
5153
@mkdir -p $(@D)
52-
$(LD) -o $@ $^ $(LDFLAGS)
54+
$(LD) -o $@ $^ $(CXXFLAGS) $(LDFLAGS)
5355

5456
$(tmpdir)/%.o: $(srcdir)/%.cpp $(COMMON)
5557
@mkdir -p $(@D)

ide/tilemap-studio.vcxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
2222
<ConfigurationType>Application</ConfigurationType>
2323
<UseDebugLibraries>true</UseDebugLibraries>
24-
<PlatformToolset>v142</PlatformToolset>
24+
<PlatformToolset>v143</PlatformToolset>
2525
<CharacterSet>Unicode</CharacterSet>
2626
</PropertyGroup>
2727
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
2828
<ConfigurationType>Application</ConfigurationType>
2929
<UseDebugLibraries>false</UseDebugLibraries>
30-
<PlatformToolset>v142</PlatformToolset>
30+
<PlatformToolset>v143</PlatformToolset>
3131
<WholeProgramOptimization>true</WholeProgramOptimization>
3232
<CharacterSet>Unicode</CharacterSet>
3333
</PropertyGroup>
@@ -74,7 +74,7 @@
7474
<Link>
7575
<SubSystem>Windows</SubSystem>
7676
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
77-
<AdditionalDependencies>fltkimagesd.lib;fltkpngd.lib;fltkzlibd.lib;fltkd.lib;opengl32.lib;glu32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
77+
<AdditionalDependencies>fltk_imagesd.lib;fltk_pngd.lib;fltk_zd.lib;fltkd.lib;opengl32.lib;glu32.lib;comctl32.lib;Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
7878
<IgnoreSpecificDefaultLibraries>libcmtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
7979
<AdditionalLibraryDirectories>..\lib\Debug</AdditionalLibraryDirectories>
8080
<AdditionalOptions>/ignore:4099 %(AdditionalOptions)</AdditionalOptions>
@@ -103,7 +103,7 @@
103103
<GenerateDebugInformation>false</GenerateDebugInformation>
104104
<EnableCOMDATFolding>true</EnableCOMDATFolding>
105105
<OptimizeReferences>true</OptimizeReferences>
106-
<AdditionalDependencies>fltkimages.lib;fltkpng.lib;fltkzlib.lib;fltk.lib;opengl32.lib;glu32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
106+
<AdditionalDependencies>fltk_images.lib;fltk_png.lib;fltk_z.lib;fltk.lib;opengl32.lib;glu32.lib;comctl32.lib;Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
107107
<IgnoreSpecificDefaultLibraries>libcmt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
108108
<AdditionalLibraryDirectories>..\lib</AdditionalLibraryDirectories>
109109
<AdditionalOptions>/ignore:4099 %(AdditionalOptions)</AdditionalOptions>

include/png.h

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22
/* png.h - header file for PNG reference library
33
*
4-
* libpng version 1.6.37 - April 14, 2019
4+
* libpng version 1.6.44
55
*
6-
* Copyright (c) 2018-2019 Cosmin Truta
6+
* Copyright (c) 2018-2024 Cosmin Truta
77
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
88
* Copyright (c) 1996-1997 Andreas Dilger
99
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -15,7 +15,7 @@
1515
* libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
1616
* libpng versions 0.97, January 1998, through 1.6.35, July 2018:
1717
* Glenn Randers-Pehrson
18-
* libpng versions 1.6.36, December 2018, through 1.6.37, April 2019:
18+
* libpng versions 1.6.36, December 2018, through 1.6.44, September 2024:
1919
* Cosmin Truta
2020
* See also "Contributing Authors", below.
2121
*/
@@ -27,8 +27,8 @@
2727
* PNG Reference Library License version 2
2828
* ---------------------------------------
2929
*
30-
* * Copyright (c) 1995-2019 The PNG Reference Library Authors.
31-
* * Copyright (c) 2018-2019 Cosmin Truta.
30+
* * Copyright (c) 1995-2024 The PNG Reference Library Authors.
31+
* * Copyright (c) 2018-2024 Cosmin Truta.
3232
* * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
3333
* * Copyright (c) 1996-1997 Andreas Dilger.
3434
* * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -239,7 +239,7 @@
239239
* ...
240240
* 1.5.30 15 10530 15.so.15.30[.0]
241241
* ...
242-
* 1.6.37 16 10637 16.so.16.37[.0]
242+
* 1.6.44 16 10644 16.so.16.44[.0]
243243
*
244244
* Henceforth the source version will match the shared-library major and
245245
* minor numbers; the shared-library major version number will be used for
@@ -255,9 +255,6 @@
255255
* to the info_ptr or png_ptr members through png.h, and the compiled
256256
* application is loaded with a different version of the library.
257257
*
258-
* DLLNUM will change each time there are forward or backward changes
259-
* in binary compatibility (e.g., when a new feature is added).
260-
*
261258
* See libpng.txt or libpng.3 for more information. The PNG specification
262259
* is available as a W3C Recommendation and as an ISO/IEC Standard; see
263260
* <https://www.w3.org/TR/2003/REC-PNG-20031110/>
@@ -278,27 +275,29 @@
278275
*/
279276

280277
/* Version information for png.h - this should match the version in png.c */
281-
#define PNG_LIBPNG_VER_STRING "1.6.37"
282-
#define PNG_HEADER_VERSION_STRING " libpng version 1.6.37 - April 14, 2019\n"
278+
#define PNG_LIBPNG_VER_STRING "1.6.44"
279+
#define PNG_HEADER_VERSION_STRING " libpng version " PNG_LIBPNG_VER_STRING "\n"
283280

284-
#define PNG_LIBPNG_VER_SONUM 16
285-
#define PNG_LIBPNG_VER_DLLNUM 16
281+
/* The versions of shared library builds should stay in sync, going forward */
282+
#define PNG_LIBPNG_VER_SHAREDLIB 16
283+
#define PNG_LIBPNG_VER_SONUM PNG_LIBPNG_VER_SHAREDLIB /* [Deprecated] */
284+
#define PNG_LIBPNG_VER_DLLNUM PNG_LIBPNG_VER_SHAREDLIB /* [Deprecated] */
286285

287286
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
288287
#define PNG_LIBPNG_VER_MAJOR 1
289288
#define PNG_LIBPNG_VER_MINOR 6
290-
#define PNG_LIBPNG_VER_RELEASE 37
289+
#define PNG_LIBPNG_VER_RELEASE 44
291290

292291
/* This should be zero for a public release, or non-zero for a
293-
* development version. [Deprecated]
292+
* development version.
294293
*/
295-
#define PNG_LIBPNG_VER_BUILD 0
294+
#define PNG_LIBPNG_VER_BUILD 0
296295

297296
/* Release Status */
298-
#define PNG_LIBPNG_BUILD_ALPHA 1
299-
#define PNG_LIBPNG_BUILD_BETA 2
300-
#define PNG_LIBPNG_BUILD_RC 3
301-
#define PNG_LIBPNG_BUILD_STABLE 4
297+
#define PNG_LIBPNG_BUILD_ALPHA 1
298+
#define PNG_LIBPNG_BUILD_BETA 2
299+
#define PNG_LIBPNG_BUILD_RC 3
300+
#define PNG_LIBPNG_BUILD_STABLE 4
302301
#define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7
303302

304303
/* Release-Specific Flags */
@@ -318,7 +317,7 @@
318317
* From version 1.0.1 it is:
319318
* XXYYZZ, where XX=major, YY=minor, ZZ=release
320319
*/
321-
#define PNG_LIBPNG_VER 10637 /* 1.6.37 */
320+
#define PNG_LIBPNG_VER 10644 /* 1.6.44 */
322321

323322
/* Library configuration: these options cannot be changed after
324323
* the library has been built.
@@ -428,7 +427,7 @@ extern "C" {
428427
/* This triggers a compiler error in png.c, if png.c and png.h
429428
* do not agree upon the version number.
430429
*/
431-
typedef char* png_libpng_version_1_6_37;
430+
typedef char* png_libpng_version_1_6_44;
432431

433432
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
434433
*
@@ -825,7 +824,7 @@ typedef PNG_CALLBACK(int, *png_user_chunk_ptr, (png_structp,
825824
* your compiler. This may be very difficult - try using a different compiler
826825
* to build the library!
827826
*/
828-
PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)), typedef);
827+
PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), (jmp_buf, int), typedef);
829828
#endif
830829

831830
/* Transform masks for the high-level interface */
@@ -849,7 +848,7 @@ PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)), typedef);
849848
#define PNG_TRANSFORM_GRAY_TO_RGB 0x2000 /* read only */
850849
/* Added to libpng-1.5.4 */
851850
#define PNG_TRANSFORM_EXPAND_16 0x4000 /* read only */
852-
#if INT_MAX >= 0x8000 /* else this might break */
851+
#if ~0U > 0xffffU /* or else this might break on a 16-bit machine */
853852
#define PNG_TRANSFORM_SCALE_16 0x8000 /* read only */
854853
#endif
855854

@@ -908,15 +907,15 @@ PNG_EXPORT(2, void, png_set_sig_bytes, (png_structrp png_ptr, int num_bytes));
908907
/* Check sig[start] through sig[start + num_to_check - 1] to see if it's a
909908
* PNG file. Returns zero if the supplied bytes match the 8-byte PNG
910909
* signature, and non-zero otherwise. Having num_to_check == 0 or
911-
* start > 7 will always fail (ie return non-zero).
910+
* start > 7 will always fail (i.e. return non-zero).
912911
*/
913912
PNG_EXPORT(3, int, png_sig_cmp, (png_const_bytep sig, size_t start,
914913
size_t num_to_check));
915914

916915
/* Simple signature checking function. This is the same as calling
917-
* png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n).
916+
* png_check_sig(sig, n) := (png_sig_cmp(sig, 0, n) == 0).
918917
*/
919-
#define png_check_sig(sig, n) !png_sig_cmp((sig), 0, (n))
918+
#define png_check_sig(sig, n) (png_sig_cmp((sig), 0, (n)) == 0) /* DEPRECATED */
920919

921920
/* Allocate and initialize png_ptr struct for reading, and any other memory. */
922921
PNG_EXPORTA(4, png_structp, png_create_read_struct,
@@ -1446,7 +1445,7 @@ PNG_EXPORT(66, void, png_set_crc_action, (png_structrp png_ptr, int crit_action,
14461445
* mainly useful for testing, as the defaults should work with most users.
14471446
* Those users who are tight on memory or want faster performance at the
14481447
* expense of compression can modify them. See the compression library
1449-
* header file (zlib.h) for an explination of the compression functions.
1448+
* header file (zlib.h) for an explanation of the compression functions.
14501449
*/
14511450

14521451
/* Set the filtering method(s) used by libpng. Currently, the only valid
@@ -1501,7 +1500,7 @@ PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed,
15011500
* 0 - 9, corresponding directly to the zlib compression levels 0 - 9
15021501
* (0 - no compression, 9 - "maximal" compression). Note that tests have
15031502
* shown that zlib compression levels 3-6 usually perform as well as level 9
1504-
* for PNG images, and do considerably fewer caclulations. In the future,
1503+
* for PNG images, and do considerably fewer calculations. In the future,
15051504
* these values may not correspond directly to the zlib compression levels.
15061505
*/
15071506
#ifdef PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED
@@ -1730,12 +1729,9 @@ PNG_EXPORT(97, void, png_free, (png_const_structrp png_ptr, png_voidp ptr));
17301729
PNG_EXPORT(98, void, png_free_data, (png_const_structrp png_ptr,
17311730
png_inforp info_ptr, png_uint_32 free_me, int num));
17321731

1733-
/* Reassign responsibility for freeing existing data, whether allocated
1732+
/* Reassign the responsibility for freeing existing data, whether allocated
17341733
* by libpng or by the application; this works on the png_info structure passed
1735-
* in, it does not change the state for other png_info structures.
1736-
*
1737-
* It is unlikely that this function works correctly as of 1.6.0 and using it
1738-
* may result either in memory leaks or double free of allocated data.
1734+
* in, without changing the state for other png_info structures.
17391735
*/
17401736
PNG_EXPORT(99, void, png_data_freer, (png_const_structrp png_ptr,
17411737
png_inforp info_ptr, int freer, png_uint_32 mask));
@@ -3207,11 +3203,18 @@ PNG_EXPORT(245, int, png_image_write_to_memory, (png_imagep image, void *memory,
32073203
#ifdef PNG_MIPS_MSA_API_SUPPORTED
32083204
# define PNG_MIPS_MSA 6 /* HARDWARE: MIPS Msa SIMD instructions supported */
32093205
#endif
3210-
#define PNG_IGNORE_ADLER32 8
3206+
#ifdef PNG_DISABLE_ADLER32_CHECK_SUPPORTED
3207+
# define PNG_IGNORE_ADLER32 8 /* SOFTWARE: disable Adler32 check on IDAT */
3208+
#endif
32113209
#ifdef PNG_POWERPC_VSX_API_SUPPORTED
3212-
# define PNG_POWERPC_VSX 10 /* HARDWARE: PowerPC VSX SIMD instructions supported */
3210+
# define PNG_POWERPC_VSX 10 /* HARDWARE: PowerPC VSX SIMD instructions
3211+
* supported */
32133212
#endif
3214-
#define PNG_OPTION_NEXT 12 /* Next option - numbers must be even */
3213+
#ifdef PNG_MIPS_MMI_API_SUPPORTED
3214+
# define PNG_MIPS_MMI 12 /* HARDWARE: MIPS MMI SIMD instructions supported */
3215+
#endif
3216+
3217+
#define PNG_OPTION_NEXT 14 /* Next option - numbers must be even */
32153218

32163219
/* Return values: NOTE: there are four values and 'off' is *not* zero */
32173220
#define PNG_OPTION_UNSET 0 /* Unset - defaults to off */

0 commit comments

Comments
 (0)