1
0
forked from 0ad/0ad

Use default Unicode encoding in source code on Windows.

This change drops MBCS encoding (which was the default for premake4)
except in the Collada project which is entirely written assuming MBCS.

Tested By: wraitii
Differential Revision: https://code.wildfiregames.com/D1069
This was SVN commit r20561.
This commit is contained in:
Nicolas Auvray 2017-11-29 20:14:22 +00:00
parent 8bb7a20ec1
commit 2da6c0ce2a
3 changed files with 10 additions and 6 deletions

View File

@ -390,7 +390,6 @@ function project_create(project_name, target_type)
kind(target_type)
filter "action:vs2013"
characterset "MBCS"
toolset "v120_xp"
filter {}
@ -1054,7 +1053,6 @@ function setup_atlas_project(project_name, target_type, rel_source_dirs, rel_inc
-- Platform Specifics
if os.istarget("windows") then
defines { "_UNICODE" }
-- Link to required libraries
links { "winmm", "comctl32", "rpcrt4", "delayimp", "ws2_32" }
@ -1187,8 +1185,6 @@ function setup_atlas_frontend_project (project_name)
-- Platform Specifics
if os.istarget("windows") then
defines { "_UNICODE" }
-- see manifest.cpp
project_add_manifest()
@ -1219,7 +1215,9 @@ function setup_collada_project(project_name, target_type, rel_source_dirs, rel_i
project_add_x11_dirs()
-- Platform Specifics
if os.istarget("linux") then
if os.istarget("windows") then
characterset "MBCS"
elseif os.istarget("linux") then
defines { "LINUX" }
links {

View File

@ -147,7 +147,11 @@ bool CreateStunRequest(ENetHost* transactionHost)
int status = getaddrinfo(server_name.c_str(), nullptr, &hints, &res);
if (status != 0)
{
#ifdef UNICODE
LOGERROR("GetPublicAddress: Error in getaddrinfo: %s", utf8_from_wstring(gai_strerror(status)));
#else
LOGERROR("GetPublicAddress: Error in getaddrinfo: %s", gai_strerror(status));
#endif
return false;
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2009 Wildfire Games.
/* Copyright (C) 2017 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -27,7 +27,9 @@
#undef CStr
// First, set up the environment for the Unicode version
#ifndef _UNICODE
#define _UNICODE
#endif
#define CStr CStrW
#define tstring wstring
#define tchar wchar_t