summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Wachter <bwachter-tmw@lart.info>2011-10-24 20:28:15 +0300
committerBernd Wachter <bwachter-tmw@lart.info>2011-10-25 13:36:33 +0300
commit8954a7ca0f70bbf167c9119d26c7bca8407e8da6 (patch)
tree5c57e4ee47518bb21ce2f0dc10d5fac963875af7
parent9c5791d3e3b413d8b703f1530f67de8936a3434c (diff)
downloadmana-8954a7ca0f70bbf167c9119d26c7bca8407e8da6.tar.gz
mana-8954a7ca0f70bbf167c9119d26c7bca8407e8da6.tar.bz2
mana-8954a7ca0f70bbf167c9119d26c7bca8407e8da6.tar.xz
mana-8954a7ca0f70bbf167c9119d26c7bca8407e8da6.zip
Change the wrong, but mostly supported WIN32 macro to the correct _WIN32, enforced by -std=c++0x
Reviewed-by: Thorbjørn Lindeijer
-rw-r--r--libs/enet/include/enet/enet.h2
-rw-r--r--libs/enet/protocol.c4
-rw-r--r--libs/enet/unix.c2
-rw-r--r--libs/enet/win32.c2
-rw-r--r--mana.cbp1
-rw-r--r--src/chatlog.cpp4
-rw-r--r--src/client.cpp18
-rw-r--r--src/gui/setup_video.cpp4
-rw-r--r--src/log.cpp4
-rw-r--r--src/main.cpp4
-rw-r--r--src/main.h2
-rw-r--r--src/utils/copynpaste.cpp2
-rw-r--r--src/utils/mkdir.cpp8
-rw-r--r--src/utils/specialfolder.cpp2
-rw-r--r--src/utils/specialfolder.h2
15 files changed, 30 insertions, 31 deletions
diff --git a/libs/enet/include/enet/enet.h b/libs/enet/include/enet/enet.h
index 02dc2c0a..c5338676 100644
--- a/libs/enet/include/enet/enet.h
+++ b/libs/enet/include/enet/enet.h
@@ -12,7 +12,7 @@ extern "C"
#include <stdlib.h>
-#ifdef WIN32
+#ifdef _WIN32
#include "enet/win32.h"
#else
#include "enet/unix.h"
diff --git a/libs/enet/protocol.c b/libs/enet/protocol.c
index d7c3fede..b51ab469 100644
--- a/libs/enet/protocol.c
+++ b/libs/enet/protocol.c
@@ -1575,7 +1575,7 @@ enet_protocol_send_outgoing_commands (ENetHost * host, ENetEvent * event, int ch
enet_uint32 packetLoss = currentPeer -> packetsLost * ENET_PEER_PACKET_LOSS_SCALE / currentPeer -> packetsSent;
#ifdef ENET_DEBUG
-#ifdef WIN32
+#ifdef _WIN32
printf (
#else
fprintf (stderr,
@@ -1625,7 +1625,7 @@ enet_protocol_send_outgoing_commands (ENetHost * host, ENetEvent * event, int ch
host -> headerFlags |= ENET_PROTOCOL_HEADER_FLAG_COMPRESSED;
shouldCompress = compressedSize;
#ifdef ENET_DEBUG_COMPRESS
-#ifdef WIN32
+#ifdef _WIN32
printf (
#else
fprintf (stderr,
diff --git a/libs/enet/unix.c b/libs/enet/unix.c
index 69715413..75c78bc8 100644
--- a/libs/enet/unix.c
+++ b/libs/enet/unix.c
@@ -2,7 +2,7 @@
@file unix.c
@brief ENet Unix system specific functions
*/
-#ifndef WIN32
+#ifndef _WIN32
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/libs/enet/win32.c b/libs/enet/win32.c
index e1fae233..0b32e633 100644
--- a/libs/enet/win32.c
+++ b/libs/enet/win32.c
@@ -2,7 +2,7 @@
@file win32.c
@brief ENet Win32 system specific functions
*/
-#ifdef WIN32
+#ifdef _WIN32
#include <time.h>
#define ENET_BUILDING_LIB 1
diff --git a/mana.cbp b/mana.cbp
index fa4495c0..4261269f 100644
--- a/mana.cbp
+++ b/mana.cbp
@@ -22,7 +22,6 @@
<Add option="-Wno-unknown-pragmas" />
<Add option="-DUSE_OPENGL" />
<Add option="-DENABLE_NLS" />
- <Add option="-DWIN32" />
</Compiler>
<Linker>
<Add option="-enable-auto-import" />
diff --git a/src/chatlog.cpp b/src/chatlog.cpp
index f33b1aff..011fa3aa 100644
--- a/src/chatlog.cpp
+++ b/src/chatlog.cpp
@@ -29,7 +29,7 @@
#include <sys/types.h>
#include <sys/time.h>
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
#elif defined __APPLE__
#include <Carbon/Carbon.h>
@@ -167,7 +167,7 @@ void ChatLogger::setServerName(const std::string &serverName)
void ChatLogger::makeDir(const std::string &dir)
{
-#ifdef WIN32
+#ifdef _WIN32
mkdir(dir.c_str());
#else
mkdir(dir.c_str(), 0750);
diff --git a/src/client.cpp b/src/client.cpp
index 5736cec4..642d9376 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -86,7 +86,7 @@
#include <physfs.h>
#include <SDL_image.h>
-#ifdef WIN32
+#ifdef _WIN32
#include <SDL_syswm.h>
#include "utils/specialfolder.h"
#else
@@ -278,7 +278,7 @@ Client::Client(const Options &options):
std::string path = options.brandingPath;
// Strip blah.mana from the path
-#ifdef WIN32
+#ifdef _WIN32
int loc1 = path.find_last_of('/');
int loc2 = path.find_last_of('\\');
int loc = std::max(loc1, loc2);
@@ -297,14 +297,14 @@ Client::Client(const Options &options):
resman->addToSearchPath(mLocalDataDir, false);
std::string iconFile = branding.getValue("appIcon", "icons/mana");
-#ifdef WIN32
+#ifdef _WIN32
iconFile += ".ico";
#else
iconFile += ".png";
#endif
iconFile = resman->getPath(iconFile);
logger->log("Loading icon from file: %s", iconFile.c_str());
-#ifdef WIN32
+#ifdef _WIN32
static SDL_SysWMinfo pInfo;
SDL_GetWMInfo(&pInfo);
// Attempt to load icon from .ico file
@@ -1069,7 +1069,7 @@ void Client::action(const gcn::ActionEvent &event)
void Client::initRootDir()
{
mRootDir = PHYSFS_getBaseDir();
-#ifdef WIN32
+#ifdef _WIN32
std::string portableName = mRootDir + "portable.xml";
struct stat statbuf;
@@ -1135,7 +1135,7 @@ void Client::initHomeDir()
#elif defined __HAIKU__
mLocalDataDir = std::string(PHYSFS_getUserDir()) +
"/config/data/Mana";
-#elif defined WIN32
+#elif defined _WIN32
mLocalDataDir = getSpecialFolderLocation(CSIDL_LOCAL_APPDATA);
if (mLocalDataDir.empty())
mLocalDataDir = std::string(PHYSFS_getUserDir());
@@ -1163,7 +1163,7 @@ void Client::initHomeDir()
mConfigDir = std::string(PHYSFS_getUserDir()) +
"/config/settings/Mana" +
branding.getValue("appName", "manasource");
-#elif defined WIN32
+#elif defined _WIN32
mConfigDir = getSpecialFolderLocation(CSIDL_APPDATA);
if (mConfigDir.empty())
mConfigDir = mLocalDataDir;
@@ -1315,7 +1315,7 @@ void Client::initUpdatesDir()
{
if (!resman->mkdir("/" + mUpdatesDir))
{
-#if defined WIN32
+#if defined _WIN32
std::string newDir = mLocalDataDir + "\\" + mUpdatesDir;
std::string::size_type loc = newDir.find("/", 0);
@@ -1351,7 +1351,7 @@ void Client::initScreenshotDir()
}
else if (mScreenshotDir.empty())
{
-#ifdef WIN32
+#ifdef _WIN32
mScreenshotDir = getSpecialFolderLocation(CSIDL_MYPICTURES);
if (mScreenshotDir.empty())
mScreenshotDir = getSpecialFolderLocation(CSIDL_DESKTOP);
diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp
index d72b402b..ea5dc140 100644
--- a/src/gui/setup_video.cpp
+++ b/src/gui/setup_video.cpp
@@ -301,7 +301,7 @@ void Setup_Video::apply()
* See http://libsdl.org/cgi/docwiki.cgi/SDL_SetVideoMode
*/
-#if defined(WIN32) || defined(__APPLE__)
+#if defined(_WIN32) || defined(__APPLE__)
// checks for opengl usage
if (!config.getBoolValue("opengl"))
{
@@ -327,7 +327,7 @@ void Setup_Video::apply()
logger->error(errorMessage.str());
}
}
-#if defined(WIN32) || defined(__APPLE__)
+#if defined(_WIN32) || defined(__APPLE__)
}
else
{
diff --git a/src/log.cpp b/src/log.cpp
index bb8a78bb..f430589b 100644
--- a/src/log.cpp
+++ b/src/log.cpp
@@ -21,7 +21,7 @@
#include "log.h"
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
#elif __APPLE__
#include <Carbon/Carbon.h>
@@ -106,7 +106,7 @@ void Logger::log(const char *log_text, ...)
void Logger::error(const std::string &error_text)
{
log("Error: %s", error_text.c_str());
-#ifdef WIN32
+#ifdef _WIN32
MessageBox(NULL, error_text.c_str(), "Error", MB_ICONERROR | MB_OK);
#elif defined __APPLE__
Str255 msg;
diff --git a/src/main.cpp b/src/main.cpp
index 08ae4a8c..fccc4c9d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -165,14 +165,14 @@ static void parseOptions(int argc, char *argv[], Client::Options &options)
}
}
-#ifdef WIN32
+#ifdef _WIN32
extern "C" char const *_nl_locale_name_default(void);
#endif
static void initInternationalization()
{
#if ENABLE_NLS
-#ifdef WIN32
+#ifdef _WIN32
SetEnvironmentVariable("LANG", _nl_locale_name_default());
// mingw doesn't like LOCALEDIR to be defined for some reason
bindtextdomain("mana", "translations/");
diff --git a/src/main.h b/src/main.h
index 82ece500..169ee7d1 100644
--- a/src/main.h
+++ b/src/main.h
@@ -52,7 +52,7 @@
#ifdef HAVE_CONFIG_H
#include "../config.h"
-#elif defined WIN32
+#elif defined _WIN32
#include "winver.h"
#elif defined __APPLE__
#define PACKAGE_VERSION "0.5.3"
diff --git a/src/utils/copynpaste.cpp b/src/utils/copynpaste.cpp
index 3d2e3b80..458a6d27 100644
--- a/src/utils/copynpaste.cpp
+++ b/src/utils/copynpaste.cpp
@@ -35,7 +35,7 @@
#include <SDL_syswm.h>
#include "copynpaste.h"
-#ifdef WIN32
+#ifdef _WIN32
bool RetrieveBuffer(std::string& text, std::string::size_type& pos)
{
bool ret = false;
diff --git a/src/utils/mkdir.cpp b/src/utils/mkdir.cpp
index 75ab8595..ee40488e 100644
--- a/src/utils/mkdir.cpp
+++ b/src/utils/mkdir.cpp
@@ -22,7 +22,7 @@
#include <cstring>
#include <cerrno>
-#if defined WIN32
+#if defined _WIN32
#include <windows.h>
#endif
@@ -51,7 +51,7 @@ int mkdir_r(const char *pathname) {
}
for (p=tmp; *p; p++) {
-#if defined WIN32
+#if defined _WIN32
if (*p == '/' || *p == '\\')
#else
if (*p == '/')
@@ -77,13 +77,13 @@ int mkdir_r(const char *pathname) {
return -1;
}
-#if defined WIN32
+#if defined _WIN32
if (!CreateDirectory(tmp, 0))
#else
if (mkdir(tmp, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH))
#endif
{
-#if defined WIN32
+#if defined _WIN32
// hack, hack. just assume that x: might be a drive
// letter, and try again
if (!(strlen(tmp) == 2 &&
diff --git a/src/utils/specialfolder.cpp b/src/utils/specialfolder.cpp
index 63337578..0c82ce68 100644
--- a/src/utils/specialfolder.cpp
+++ b/src/utils/specialfolder.cpp
@@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifdef WIN32
+#ifdef _WIN32
#include "specialfolder.h"
#include <windows.h>
diff --git a/src/utils/specialfolder.h b/src/utils/specialfolder.h
index eef6416b..0c3e999c 100644
--- a/src/utils/specialfolder.h
+++ b/src/utils/specialfolder.h
@@ -21,7 +21,7 @@
#ifndef SPECIALFOLDER_H
#define SPECIALFOLDER_H
-#ifdef WIN32
+#ifdef _WIN32
#include <shlobj.h>
#include <string>
std::string getSpecialFolderLocation(int folderId);