[Openvpn-devel,1/2] msvc: Unify Unicode/MultiByte string setting across all cfg|plat

Message ID 20181008094600.10164-1-simon@rozman.si
State Accepted
Headers show
Series
  • [Openvpn-devel,1/2] msvc: Unify Unicode/MultiByte string setting across all cfg|plat
Related show

Commit Message

Simon Rozman Oct. 8, 2018, 9:45 a.m.
The openvpnserv.vcxproj source code is Windows API Unicode compliant
with only Debug|x64 set to Unicode, while other cfg|plat pairs were set
to MultiByte.
---
 src/openvpnserv/openvpnserv.vcxproj | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Lev Stipakov Oct. 8, 2018, 10:41 a.m. | #1
Hi,

Makes sense. Tested on VS2017.

Acked-by: Lev Stipakov <lev@openvpn.net>

Since in MinGW/VS we only build openvpnserv with unicode I wonder if we
should get rid of #if(n)def UNICODE ?

-Lev
<div dir="ltr"><div dir="ltr">Hi,<div><br></div><div>Makes sense. Tested on VS2017. </div><div><br></div><div><span class="m_498324897834289559gmail-il">Acked</span>-<span class="m_498324897834289559gmail-il">by</span>: Lev Stipakov &lt;<a href="mailto:lev@openvpn.net" target="_blank">lev@openvpn.net</a>&gt;  <br></div><div><br></div><div>Since in MinGW/VS we only build openvpnserv with unicode I wonder if we should get rid of #if(n)def UNICODE ?</div><div><br></div><div>-Lev</div></div></div>
Simon Rozman Oct. 8, 2018, 11:51 a.m. | #2
Hi,



It would make the code cleaner, I agree.





Since in MinGW/VS we only build openvpnserv with unicode I wonder if we should 
get rid of #if(n)def UNICODE ?
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p.Code, li.Code, div.Code
	{mso-style-name:Code;
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
	{mso-style-name:msonormal;
	mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
span.m498324897834289559gmail-il
	{mso-style-name:m_498324897834289559gmail-il;}
span.EmailStyle20
	{mso-style-type:personal-reply;
	font-family:"Calibri",sans-serif;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri",sans-serif;
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=SL link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-US'>Hi,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-US'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-US'>It would make the code cleaner, I agree.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-US'><o:p>&nbsp;</o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'><div><div><div><p class=MsoNormal><span lang=EN-GB><o:p>&nbsp;</o:p></span></p></div><div><p class=MsoNormal><span lang=EN-GB>Since in MinGW/VS we only build openvpnserv with unicode I wonder if we should get rid of #if(n)def UNICODE ?<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-GB><o:p>&nbsp;</o:p></span></p></div></div></div></div></div></body></html>
Selva Nair Oct. 8, 2018, 2:12 p.m. | #3
On Mon, Oct 8, 2018 at 6:42 AM Lev Stipakov <lstipakov@gmail.com> wrote:

> Hi,
>
> Makes sense. Tested on VS2017.
>
> Acked-by: Lev Stipakov <lev@openvpn.net>
>
> Since in MinGW/VS we only build openvpnserv with unicode I wonder if we
> should get rid of #if(n)def UNICODE ?
>

In fact the non-unicode build is its unlikely to work anymore -- there are
number of places we implicitly assume that TCHAR = WCHAR. So assuming
UNICODE is defined (and refusing to build otherwise) would be good.

Selva
<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Oct 8, 2018 at 6:42 AM Lev Stipakov &lt;<a href="mailto:lstipakov@gmail.com">lstipakov@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr">Hi,<div><br></div><div>Makes sense. Tested on VS2017. </div><div><br></div><div><span class="m_-3726212025145446704m_498324897834289559gmail-il">Acked</span>-<span class="m_-3726212025145446704m_498324897834289559gmail-il">by</span>: Lev Stipakov &lt;<a href="mailto:lev@openvpn.net" target="_blank">lev@openvpn.net</a>&gt;  <br></div><div><br></div><div>Since in MinGW/VS we only build openvpnserv with unicode I wonder if we should get rid of #if(n)def UNICODE ?</div></div></div></blockquote><div><br></div><div>In fact the non-unicode build is its unlikely to work anymore -- there are number of places we implicitly assume that TCHAR = WCHAR. So assuming UNICODE is defined (and refusing to build otherwise) would be good.</div><div><br></div><div>Selva</div><div><br></div></div></div>
Gert Doering Oct. 8, 2018, 2:59 p.m. | #4
As for the other XML project patch, I trust you, Lev and Selva to know 
what you are doing :-)

Your patch has been applied to the master branch.

commit 279aa11978f07494a3b665a619fa74c9d4b1485b
Author: Simon Rozman
Date:   Mon Oct 8 11:45:59 2018 +0200

     msvc: Unify Unicode/MultiByte string setting across all cfg|plat

     Acked-by: Lev Stipakov <lstipakov@gmail.com>
     Message-Id: <20181008094600.10164-1-simon@rozman.si>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg17633.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpnserv/openvpnserv.vcxproj b/src/openvpnserv/openvpnserv.vcxproj
index 9098920e..4edcf851 100644
--- a/src/openvpnserv/openvpnserv.vcxproj
+++ b/src/openvpnserv/openvpnserv.vcxproj
@@ -27,19 +27,19 @@ 
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
+    <CharacterSet>Unicode</CharacterSet>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <PlatformToolset>v141</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
+    <CharacterSet>Unicode</CharacterSet>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <PlatformToolset>v141</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
+    <CharacterSet>Unicode</CharacterSet>
     <PlatformToolset>v141</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">