From d868ec0a5071f629c0f144d35bd32ecaece7fd58 Mon Sep 17 00:00:00 2001 From: Giel van Schijndel Date: Thu, 24 Jan 2008 00:43:10 +0000 Subject: [PATCH] * Make Win::HWND a "strong" typedef; this guarantees that code that just assumes Win::HWND is the same type as ::HWND (from ) will fail to compile git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3551 4a71c877-e1ca-e34f-864e-861f7616d084 --- tools/editworld/src/winapi.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/editworld/src/winapi.hpp b/tools/editworld/src/winapi.hpp index 865adb195..46e32e7b1 100644 --- a/tools/editworld/src/winapi.hpp +++ b/tools/editworld/src/winapi.hpp @@ -32,6 +32,7 @@ #include #include #include +#include #ifdef ShellExecute # undef ShellExecute @@ -93,10 +94,10 @@ namespace Win */ std::string GetCurrentDirectory(); - /** @note: Don't depend on this typedef remaining ::HWND for ever, it might - * be wrapped in some class later on. + /** @note Don't depend on this typedef remaining ::HWND for ever, it might + * be wrapped in some class later on. */ - typedef ::HWND HWND; + BOOST_STRONG_TYPEDEF(::HWND, HWND); enum show_command { @@ -141,7 +142,7 @@ namespace Win const charT* operation = NULL, const charT* parameters = NULL, const charT* directory = NULL, - HWND hwnd = NULL, + HWND hwnd = HWND(NULL), show_command showCmd = show_command_normal) { return ShellExecute(hwnd, operation, fileName, parameters, directory, showCmd); @@ -154,7 +155,7 @@ namespace Win const std::basic_string& operation = std::basic_string(), const std::basic_string& parameters = std::basic_string(), const std::basic_string& directory = std::basic_string(), - HWND hwnd = NULL, + HWND hwnd = HWND(NULL), show_command showCmd = show_command_normal) { const charT * const file = fileName.c_str();