From 19f08ce36be89c019a0a4052f17cb8e454ab79d7 Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Wed, 14 Aug 2024 23:52:31 +0200 Subject: [PATCH 1/2] Apply Guichan's changes from 55d486ee529aa74bd0c049196dd5e1e952d4d110 (Apr 12th 2008) DELETE is now undefined in key.hpp if p --- TODO | 2 +- include/guisan/key.hpp | 7 +++++++ include/guisan/opengl/openglimage.hpp | 9 +++------ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/TODO b/TODO index 9a4b62f..37f3be1 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -* Continue rebasing from d0400d4714bcdad2d1f00283c80e77317147ea5c +* Continue rebasing from ac9bf923e621cd62880661cfb372286211e8bc29 * Add a focus listener interface. * Make focus apply synchronously. * Graphics and input objects for DirectX. diff --git a/include/guisan/key.hpp b/include/guisan/key.hpp index a41890e..7d04d67 100644 --- a/include/guisan/key.hpp +++ b/include/guisan/key.hpp @@ -59,6 +59,13 @@ #include "guisan/platform.hpp" +// defines DELETE which breaks this file as we have a constant named +// DELETE, hence we undefine DELETE if it is defined and hope people don't use +// that windows define with Guisan. +#if defined(_WIN32) && defined(DELETE) +# undef DELETE +#endif + namespace gcn { /** diff --git a/include/guisan/opengl/openglimage.hpp b/include/guisan/opengl/openglimage.hpp index a0cdae5..3243be8 100644 --- a/include/guisan/opengl/openglimage.hpp +++ b/include/guisan/opengl/openglimage.hpp @@ -57,12 +57,9 @@ #ifndef GCN_OPENGLIMAGE_HPP #define GCN_OPENGLIMAGE_HPP -#if defined (_WIN32) -#define WIN32_LEAN_AND_MEAN -#include -#if defined (DELETE) -#undef DELETE -#endif +#if defined(_WIN32) +# define WIN32_LEAN_AND_MEAN +# include #endif #if defined (__APPLE__) From 45cafb33f244e640b2184f4fa7756c00a3f75f7e Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Wed, 14 Aug 2024 23:57:10 +0200 Subject: [PATCH 2/2] Apply Guichan's changes from ac9bf923e621cd62880661cfb372286211e8bc29 (Apr 12th 2008) Has been updated. --- ChangeLog | 3 +++ TODO | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 61df639..c364bda 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,9 @@ Version 1.1.0 * Widget::hasModalFocus has been renamed to Widget::isModalFocused. * Widget::hasModalMouseInputFocus has been renamed to Widget::isModalMouseInputFocused. * Widget::generateAction has been renamed to Widget::distributeActionEvent. +* DELETE is now undefined in Key.hpp if present. It should hopefully + take care of some problems with windows.h defining delete which + sometimes breaks Key.hpp. Version 1.0.0 ============= diff --git a/TODO b/TODO index 37f3be1..4bfc0bc 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -* Continue rebasing from ac9bf923e621cd62880661cfb372286211e8bc29 +* Continue rebasing from 063dc975e98dfc74c2565229ce175cccc70fa4dd * Add a focus listener interface. * Make focus apply synchronously. * Graphics and input objects for DirectX.