CMake/Windows only: add missing #define WIN32 for all compilers.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@12613 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Albrecht Schlosser 2017-12-28 23:22:43 +00:00
parent a124051e7e
commit aa216a46d4
2 changed files with 8 additions and 1 deletions

View File

@ -3,6 +3,10 @@ CHANGES IN FLTK 1.3.5 RELEASED: ??? ?? 2017
Bug fixes and other improvements
- Windows/CMake: Add missing definition of WIN32 for Windows builds.
This seems to be necessary for VS2017 and other compilers that
don't #define WIN32, but FLTK relies on this preprocessor macro.
Autoconf/configure and bundled IDE files #define WIN32 as well.
- Fix illegal memory access after free when closing fluid (valgrind
reports "Invalid read of size 4"), see also STR #3427.
- Fix crash when closing fluid with Fl_Table (STR #3427).

View File

@ -4,7 +4,7 @@
# CMakeLists.txt to build the FLTK project using CMake (www.cmake.org)
# Written by Michael Surette
#
# Copyright 1998-2015 by Bill Spitzak and others.
# Copyright 1998-2017 by Bill Spitzak and others.
#
# This library is free software. Distribution and use rights are outlined in
# the file "COPYING" which should have been included with this file. If this
@ -68,6 +68,8 @@ set(FLTK_DOCDIR ${CMAKE_INSTALL_DATADIR}/doc CACHE PATH
# platform dependent information
#######################################################################
# The following part is probably wrong but does no harm.
# This will be removed in FLTK 1.4.0. AlbrechtS, Dec 28, 2017.
# fix no WIN32 defined issue
if(NOT WIN32)
if(_WIN32)
@ -107,6 +109,7 @@ if(APPLE)
endif(APPLE)
if(WIN32)
add_definitions(-DWIN32)
if(MSVC)
add_definitions(-DWIN32_LEAN_AND_MEAN)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)