Skip to contentSkip to conversation

Change in openvpn[master]: configure/CMake: Unify Windows handling

Openvpn-devel In review flichtenheld (Code Review) 2 participants 7 messages Nov 26, 2025 – Nov 27, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1764176932000.Ic55e1288b0d3160e68eef07ff4edbb070a03dd31@...2715...

#1 lore raw

Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1410?usp=email

to review the following change.

Change subject: configure/CMake: Unify Windows handling
......................................................................

configure/CMake: Unify Windows handling

Some things were detected in configure.ac and just hard-coded in CMake. Move the hard-coding to syshead.h instead and remove the additional code in configure.ac. These are really Windows-specific so I think not dynamically detecting is okay.

Change-Id Ic55e1288b0d3160e68eef07ff4edbb070a03dd31

---
M config.h.cmake.in
M configure.ac
M src/openvpn/syshead.h

3 files changed, 29 insertions(+), 83 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/10/1410/1

config.h.cmake.in +0 -29
index f68ea27..bf1388c 100644
@@ -411,32 +411,3 @@
 #ifndef _GNU_SOURCE
 # define _GNU_SOURCE 1
 #endif
-
-/* if inttypes.h is included this breaks rc.exe when using the ClangCL
- * Toolchain as it pulls in a inttypes.h variant for clang that rc.exe does
- * not understand (#include_next preprocessor directive) */
-#if defined(_WIN32) && !defined(RC_INVOKED)
-#include <inttypes.h>
-typedef uint32_t in_addr_t;
-typedef uint16_t in_port_t;
-
-#define SIGHUP    1
-#define SIGINT    2
-#define SIGUSR1   10
-#define SIGUSR2   12
-#define SIGTERM   15
-#endif
-
-#if defined(_MSC_VER) && !defined(RC_INVOKED)
-#include <BaseTsd.h>
-typedef SSIZE_T ssize_t;
-#define strncasecmp strnicmp
-#define strcasecmp _stricmp
-
-#define S_IRUSR _S_IREAD
-#define S_IWUSR _S_IWRITE
-#define R_OK 4
-#define W_OK 2
-#define X_OK 1
-#define F_OK 0
-#endif
configure.ac +0 -54

66 lines not on this page · raw message

src/openvpn/syshead.h +29 -0
index 70ba1fb..724d307 100644
@@ -44,6 +44,35 @@
 #define srandom  srand
 #endif
 
+/* if inttypes.h is included this breaks rc.exe when using the ClangCL
+ * Toolchain as it pulls in a inttypes.h variant for clang that rc.exe does
+ * not understand (#include_next preprocessor directive) */
+#if defined(_WIN32) && !defined(RC_INVOKED)
+#include <inttypes.h>
+typedef uint32_t in_addr_t;
+typedef uint16_t in_port_t;
+
+#define SIGHUP  1
+#define SIGINT  2
+#define SIGUSR1 10
+#define SIGUSR2 12
+#define SIGTERM 15
+#endif
+
+#if defined(_MSC_VER) && !defined(RC_INVOKED)
+#include <BaseTsd.h>
+typedef SSIZE_T ssize_t;
+#define strncasecmp strnicmp
+#define strcasecmp  _stricmp
+
+#define S_IRUSR _S_IREAD
+#define S_IWUSR _S_IWRITE
+#define R_OK    4
+#define W_OK    2
+#define X_OK    1
+#define F_OK    0
+#endif
+
 #if defined(_MSC_VER) && !defined(__clang__) /* Microsoft compiler */
 #define __func__ __FUNCTION__
 #define __attribute__(x)

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1410?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ic55e1288b0d3160e68eef07ff4edbb070a03dd31
Gerrit-Change-Number: 1410
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld.

plaisthos has posted comments on this change by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1410?usp=email )

Change subject: configure/CMake: Unify Windows handling
......................................................................

Patch Set 2: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1410?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ic55e1288b0d3160e68eef07ff4edbb070a03dd31
Gerrit-Change-Number: 1410
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Thu, 27 Nov 2025 10:22:57 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

#3 lore raw

PATCH v2 1/1 configure/CMake: Unify Windows handling

In reply to a message not in the archive

From: Frank Lichtenheld <[email protected]...>

Some things were detected in configure.ac and just hard-coded in CMake. Move the hard-coding to syshead.h instead and remove the additional code in configure.ac. These are really Windows-specific so I think not dynamically detecting is okay.

Change-Id Ic55e1288b0d3160e68eef07ff4edbb070a03dd31

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1410
---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1410
This mail reflects revision 2 of this Change.

Acked-by according to Gerrit (reflected above):
Arne Schwabe <[email protected]...>

config.h.cmake.in +0 -29
index f68ea27..bf1388c 100644
@@ -411,32 +411,3 @@
 #ifndef _GNU_SOURCE
 # define _GNU_SOURCE 1
 #endif
-
-/* if inttypes.h is included this breaks rc.exe when using the ClangCL
- * Toolchain as it pulls in a inttypes.h variant for clang that rc.exe does
- * not understand (#include_next preprocessor directive) */
-#if defined(_WIN32) && !defined(RC_INVOKED)
-#include <inttypes.h>
-typedef uint32_t in_addr_t;
-typedef uint16_t in_port_t;
-
-#define SIGHUP    1
-#define SIGINT    2
-#define SIGUSR1   10
-#define SIGUSR2   12
-#define SIGTERM   15
-#endif
-
-#if defined(_MSC_VER) && !defined(RC_INVOKED)
-#include <BaseTsd.h>
-typedef SSIZE_T ssize_t;
-#define strncasecmp strnicmp
-#define strcasecmp _stricmp
-
-#define S_IRUSR _S_IREAD
-#define S_IWUSR _S_IWRITE
-#define R_OK 4
-#define W_OK 2
-#define X_OK 1
-#define F_OK 0
-#endif
configure.ac +0 -54

66 lines not on this page · raw message

src/openvpn/syshead.h +29 -0
index c6f2608..627ba92 100644
@@ -44,6 +44,35 @@
 #define srandom  srand
 #endif
 
+/* if inttypes.h is included this breaks rc.exe when using the ClangCL
+ * Toolchain as it pulls in a inttypes.h variant for clang that rc.exe does
+ * not understand (#include_next preprocessor directive) */
+#if defined(_WIN32) && !defined(RC_INVOKED)
+#include <inttypes.h>
+typedef uint32_t in_addr_t;
+typedef uint16_t in_port_t;
+
+#define SIGHUP  1
+#define SIGINT  2
+#define SIGUSR1 10
+#define SIGUSR2 12
+#define SIGTERM 15
+#endif
+
+#if defined(_MSC_VER) && !defined(RC_INVOKED)
+#include <BaseTsd.h>
+typedef SSIZE_T ssize_t;
+#define strncasecmp strnicmp
+#define strcasecmp  _stricmp
+
+#define S_IRUSR _S_IREAD
+#define S_IWUSR _S_IWRITE
+#define R_OK    4
+#define W_OK    2
+#define X_OK    1
+#define F_OK    0
+#endif
+
 #if defined(_MSC_VER) && !defined(__clang__) /* Microsoft compiler */
 #define __func__ __FUNCTION__
 #define __attribute__(x)
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: configure/CMake: Unify Windows handling

Aaand another one. This one I have tested on Ubuntu 24.04/MinGW64 with autoconf, because BB only does cmake building (IIRC?), and also pushed to GHA (more windows build variants, windows UTs). All green.

Your patch has been applied to the master branch.

commit afdf0028808b9b7809059f3368a396dcbcdf2565

Author: Frank Lichtenheld
Date:   Thu Nov 27 11:37:05 2025 +0100
     configure/CMake: Unify Windows handling

     Signed-off-by: Frank Lichtenheld <[email protected]...>
     Acked-by: Arne Schwabe <[email protected]...>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1410
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg34736.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw

[Openvpn-devel] [PATCH applied] Re: configure/CMake: Unify Windows handling

In reply to Gert Doering

Aaand another one. This one I have tested on Ubuntu 24.04/MinGW64 with autoconf, because BB only does cmake building (IIRC?), and also pushed to GHA (more windows build variants, windows UTs). All green.

Your patch has been applied to the master branch.

commit afdf0028808b9b7809059f3368a396dcbcdf2565

Author: Frank Lichtenheld
Date:   Thu Nov 27 11:37:05 2025 +0100
     configure/CMake: Unify Windows handling

     Signed-off-by: Frank Lichtenheld <[email protected]...>
     Acked-by: Arne Schwabe <[email protected]...>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1410
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg34736.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#6 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#3) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1410?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by plaisthos

Change subject: configure/CMake: Unify Windows handling
......................................................................

configure/CMake: Unify Windows handling

Some things were detected in configure.ac and just hard-coded in CMake. Move the hard-coding to syshead.h instead and remove the additional code in configure.ac. These are really Windows-specific so I think not dynamically detecting is okay.

Change-Id Ic55e1288b0d3160e68eef07ff4edbb070a03dd31

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1410
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg34736.html

---
M config.h.cmake.in
M configure.ac
M src/openvpn/syshead.h

3 files changed, 29 insertions(+), 83 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/10/1410/3

config.h.cmake.in +0 -29
index f68ea27..bf1388c 100644
@@ -411,32 +411,3 @@
 #ifndef _GNU_SOURCE
 # define _GNU_SOURCE 1
 #endif
-
-/* if inttypes.h is included this breaks rc.exe when using the ClangCL
- * Toolchain as it pulls in a inttypes.h variant for clang that rc.exe does
- * not understand (#include_next preprocessor directive) */
-#if defined(_WIN32) && !defined(RC_INVOKED)
-#include <inttypes.h>
-typedef uint32_t in_addr_t;
-typedef uint16_t in_port_t;
-
-#define SIGHUP    1
-#define SIGINT    2
-#define SIGUSR1   10
-#define SIGUSR2   12
-#define SIGTERM   15
-#endif
-
-#if defined(_MSC_VER) && !defined(RC_INVOKED)
-#include <BaseTsd.h>
-typedef SSIZE_T ssize_t;
-#define strncasecmp strnicmp
-#define strcasecmp _stricmp
-
-#define S_IRUSR _S_IREAD
-#define S_IWUSR _S_IWRITE
-#define R_OK 4
-#define W_OK 2
-#define X_OK 1
-#define F_OK 0
-#endif
configure.ac +0 -54

66 lines not on this page · raw message

src/openvpn/syshead.h +29 -0
index c6f2608..627ba92 100644
@@ -44,6 +44,35 @@
 #define srandom  srand
 #endif
 
+/* if inttypes.h is included this breaks rc.exe when using the ClangCL
+ * Toolchain as it pulls in a inttypes.h variant for clang that rc.exe does
+ * not understand (#include_next preprocessor directive) */
+#if defined(_WIN32) && !defined(RC_INVOKED)
+#include <inttypes.h>
+typedef uint32_t in_addr_t;
+typedef uint16_t in_port_t;
+
+#define SIGHUP  1
+#define SIGINT  2
+#define SIGUSR1 10
+#define SIGUSR2 12
+#define SIGTERM 15
+#endif
+
+#if defined(_MSC_VER) && !defined(RC_INVOKED)
+#include <BaseTsd.h>
+typedef SSIZE_T ssize_t;
+#define strncasecmp strnicmp
+#define strcasecmp  _stricmp
+
+#define S_IRUSR _S_IREAD
+#define S_IWUSR _S_IWRITE
+#define R_OK    4
+#define W_OK    2
+#define X_OK    1
+#define F_OK    0
+#endif
+
 #if defined(_MSC_VER) && !defined(__clang__) /* Microsoft compiler */
 #define __func__ __FUNCTION__
 #define __attribute__(x)

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1410?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ic55e1288b0d3160e68eef07ff4edbb070a03dd31
Gerrit-Change-Number: 1410
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>

#7 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1410?usp=email )

Change subject: configure/CMake: Unify Windows handling
......................................................................

configure/CMake: Unify Windows handling

Some things were detected in configure.ac and just hard-coded in CMake. Move the hard-coding to syshead.h instead and remove the additional code in configure.ac. These are really Windows-specific so I think not dynamically detecting is okay.

Change-Id Ic55e1288b0d3160e68eef07ff4edbb070a03dd31

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1410
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg34736.html

---
M config.h.cmake.in
M configure.ac
M src/openvpn/syshead.h

3 files changed, 29 insertions(+), 83 deletions(-)
config.h.cmake.in +0 -29
index f68ea27..bf1388c 100644
@@ -411,32 +411,3 @@
 #ifndef _GNU_SOURCE
 # define _GNU_SOURCE 1
 #endif
-
-/* if inttypes.h is included this breaks rc.exe when using the ClangCL
- * Toolchain as it pulls in a inttypes.h variant for clang that rc.exe does
- * not understand (#include_next preprocessor directive) */
-#if defined(_WIN32) && !defined(RC_INVOKED)
-#include <inttypes.h>
-typedef uint32_t in_addr_t;
-typedef uint16_t in_port_t;
-
-#define SIGHUP    1
-#define SIGINT    2
-#define SIGUSR1   10
-#define SIGUSR2   12
-#define SIGTERM   15
-#endif
-
-#if defined(_MSC_VER) && !defined(RC_INVOKED)
-#include <BaseTsd.h>
-typedef SSIZE_T ssize_t;
-#define strncasecmp strnicmp
-#define strcasecmp _stricmp
-
-#define S_IRUSR _S_IREAD
-#define S_IWUSR _S_IWRITE
-#define R_OK 4
-#define W_OK 2
-#define X_OK 1
-#define F_OK 0
-#endif
configure.ac +0 -54

66 lines not on this page · raw message

src/openvpn/syshead.h +29 -0
index c6f2608..627ba92 100644
@@ -44,6 +44,35 @@
 #define srandom  srand
 #endif
 
+/* if inttypes.h is included this breaks rc.exe when using the ClangCL
+ * Toolchain as it pulls in a inttypes.h variant for clang that rc.exe does
+ * not understand (#include_next preprocessor directive) */
+#if defined(_WIN32) && !defined(RC_INVOKED)
+#include <inttypes.h>
+typedef uint32_t in_addr_t;
+typedef uint16_t in_port_t;
+
+#define SIGHUP  1
+#define SIGINT  2
+#define SIGUSR1 10
+#define SIGUSR2 12
+#define SIGTERM 15
+#endif
+
+#if defined(_MSC_VER) && !defined(RC_INVOKED)
+#include <BaseTsd.h>
+typedef SSIZE_T ssize_t;
+#define strncasecmp strnicmp
+#define strcasecmp  _stricmp
+
+#define S_IRUSR _S_IREAD
+#define S_IWUSR _S_IWRITE
+#define R_OK    4
+#define W_OK    2
+#define X_OK    1
+#define F_OK    0
+#endif
+
 #if defined(_MSC_VER) && !defined(__clang__) /* Microsoft compiler */
 #define __func__ __FUNCTION__
 #define __attribute__(x)

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1410?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ic55e1288b0d3160e68eef07ff4edbb070a03dd31
Gerrit-Change-Number: 1410
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>