[Openvpn-devel,for,2.5] Fix some more wrong defines in config-msvc.h

Message ID 20211015184733.16988-1-selva.nair@gmail.com
State Accepted
Headers show
Series [Openvpn-devel,for,2.5] Fix some more wrong defines in config-msvc.h | expand

Commit Message

Selva Nair Oct. 15, 2021, 7:47 a.m. UTC
From: Selva Nair <selva.nair@gmail.com>

Not sure where these came from, but here goes:

S_IRUSR = 0 --> _S_IREAD
S_IWUSR = 0 --> _S_IWRITE

ENABLE_DEBUG is on, but I do not think we want it in production build.
Changed to ENABLE_DEBUG 0

S_IRGRP is not defined but seems to be used. I have added it, remove if
not required.
This define is based on mingw and matches MS docs on <filesystem>
(https://docs.microsoft.com/en-us/cpp/standard-library/filesystem-enumerations?view=msvc-160)

Should fix Trac #1430 but untested (I do not have a setup at hand for msvc build).

Signed-off-by: Selva Nair <selva.nair@gmail.com>
---
 config-msvc.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Lev Stipakov Oct. 17, 2021, 8:56 p.m. UTC | #1
Looks good (I commented already in 2.5 version) apart from

> -#define ENABLE_DEBUG 1
> +#define ENABLE_DEBUG 0

which doesn't undef it.

If cron2 can fix it during commit, consider this as ack.
Selva Nair Oct. 18, 2021, 12:25 a.m. UTC | #2
Hi

On Mon, Oct 18, 2021 at 3:56 AM Lev Stipakov <lstipakov@gmail.com> wrote:

> Looks good (I commented already in 2.5 version) apart from
>
> > -#define ENABLE_DEBUG 1
> > +#define ENABLE_DEBUG 0
>
> which doesn't undef it.
>

Right, we check it using #ifdef, not #if.

Gert: do you need a v2 or can you remove the line please?

Selva
<div dir="ltr"><div>Hi</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 18, 2021 at 3:56 AM Lev Stipakov &lt;<a href="mailto:lstipakov@gmail.com">lstipakov@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Looks good (I commented already in 2.5 version) apart from<br>
<br>
&gt; -#define ENABLE_DEBUG 1<br>
&gt; +#define ENABLE_DEBUG 0<br>
<br>
which doesn&#39;t undef it.<br></blockquote><div><br></div><div>Right, we check it using #ifdef, not #if. </div><div><br></div><div>Gert: do you need a v2 or can you remove the line please?</div><div><br></div><div>Selva</div></div></div>
Gert Doering Oct. 18, 2021, 1:03 a.m. UTC | #3
Hi,

On Mon, Oct 18, 2021 at 07:25:02AM -0400, Selva Nair wrote:
> Gert: do you need a v2 or can you remove the line please?

I'll do it on the fly.  The intent is clear.

gert
Gert Doering Oct. 18, 2021, 10:41 p.m. UTC | #4
Thanks.

I have adjusted the commit message ("should fix Trac #1430") and removed
the #define ENABLE_DEBUG 0, as instructed.

Your patch has been applied to the release/2.5 branch.

commit c699c0d85cf2028796cdb0592271f1167709e6ac
Author: Selva Nair
Date:   Fri Oct 15 14:47:33 2021 -0400

     Fix some more wrong defines in config-msvc.h

     Signed-off-by: Selva Nair <selva.nair@gmail.com>
     Acked-by: Lev Stipakov <lstipakov@gmail.com>
     Message-Id: <20211015184733.16988-1-selva.nair@gmail.com>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22943.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/config-msvc.h b/config-msvc.h
index a39eeed8..9fc8d1cc 100644
--- a/config-msvc.h
+++ b/config-msvc.h
@@ -5,8 +5,7 @@ 
 #define ENABLE_DEF_AUTH 1
 #define ENABLE_PF 1
 #define ENABLE_CRYPTO_OPENSSL 1
-#define ENABLE_DEBUG 1
-#define ENABLE_EUREPHIA 1
+#define ENABLE_DEBUG 0
 #define ENABLE_FRAGMENT 1
 #define ENABLE_HTTP_PROXY 1
 #define ENABLE_LZO 1
@@ -144,8 +143,9 @@ 
 #define in_addr_t uint32_t
 #define ssize_t SSIZE_T
 
-#define S_IRUSR 0
-#define S_IWUSR 0
+#define S_IRUSR _S_IREAD
+#define S_IWUSR _S_IWRITE
+#define S_IRGRP (S_IRUSR >> 3)
 #define R_OK 4
 #define W_OK 2
 #define X_OK 1