From patchwork Tue Sep 17 15:04:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "plaisthos (Code Review)" X-Patchwork-Id: 3841 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:6794:b0:5b9:581e:f939 with SMTP id c20csp231910mao; Tue, 17 Sep 2024 08:05:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXHi/EzxFofc1fZq7ljrZFEmfVmywro3SzWDK9jMGmr01OB21mVU9J1VQju+PJQPUwA8Q9CWJX5+wI=@openvpn.net X-Google-Smtp-Source: AGHT+IExuEI0SlElh4H5dloxv8eNp17qTR13pPQWwq6cDR6y8wi5r4i8VopMUMvT8dwVM/bZ3Rmb X-Received: by 2002:a05:6830:8d0:b0:710:f5d5:9059 with SMTP id 46e09a7af769-71116c61022mr9613506a34.26.1726585510792; Tue, 17 Sep 2024 08:05:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726585510; cv=none; d=google.com; s=arc-20240605; b=FVOJHY1nU/lSWTo8CUTCQyOyU00MrAdec3hzIPnuP//2VES3h1li2VibM0xnHyq58e hE957dR/ZKGVvCxQTCAOByRq0dINhKw9y479dvVTQrhgCf5fIvOgxTY8Xr+spA7bkCg+ 2/ePAkTlk7jJUq2vPG9u4469f4o+ZWRXZ5Fa+W0PnG5ovjxC5Nve3/fzHrKxbdeCJ5+t Zz+cB4l+eG7IjAe/HUPHtJyU3zVby7EtrEhqXz/n7tHx3rpoBnN6J4YuJBra1Wgw0SFx cj+CNk/F46K4/J3PXyttMPO5roaww2ou18hSDjbO5mJTY18Lxuj/7qC/L7NKRDFaj4By F7zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:user-agent :mime-version:message-id:references:auto-submitted:to:date:from :dkim-signature:dkim-signature:dkim-signature; bh=sUYVbuwSMNaggnpZMbXs+WqisiIgnR77GNJc16DddaU=; fh=lm0MLPW7DntlrDqRECIiC9JlE1uPxhepE0URYHIf+eE=; b=RytMz2dHrc0XTa9ph2zqGjEIEQMTqGTYRD1Pg11m0zxpAMYaSUTUjUo6px6v4sbbPT lLiYlbAsi5ewdvOTyfk+ZuJ0KnxZZEkBsW3i7MtkWO4ex0tu+oYZEz8DPsWFsh/DViPm ypVz8Km6JCCV2gQOjDSAYu5Ysmltn/JT8XiI/zTFWOsjcMeJT3oZfcK9hckIMDY4bpK+ a8WM1EaeVX/5xf0ERi92JeX211mVxtE3RooJXdFjGrbIz/RbLkNb32J3JIP2eW6Y0Gw4 mI9m9PRSNiZGhTq32ef8EsffdmStWJvqPWuNWNT0R6NgBJY2Fl0mA2Z47PwmdackiuJ0 t8mg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=NDC8YefN; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Tke8SJIf; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=Z98Bw5Ok; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvpn.net; dara=fail header.i=@openvpn.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 46e09a7af769-71239f56a9esi3222391a34.278.2024.09.17.08.05.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Sep 2024 08:05:10 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=NDC8YefN; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Tke8SJIf; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=Z98Bw5Ok; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvpn.net; dara=fail header.i=@openvpn.net Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1sqZlB-0001oe-A4; Tue, 17 Sep 2024 15:04:57 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1sqZlA-0001oT-E0 for openvpn-devel@lists.sourceforge.net; Tue, 17 Sep 2024 15:04:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :Message-ID:Reply-To:References:Subject:List-Unsubscribe:List-Id:Cc:To:Date: From:Sender:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help: List-Subscribe:List-Post:List-Owner:List-Archive; bh=p8Va3BaBJzhL4treDtSK3zAViq6hJ+0t/1wHsYup1b8=; b=NDC8YefNyPBrPDCvU2IS4A2+zp xlrvVDkaDS1aQ1bPoD7xGTnATytzI6KXSJ9xVQdn6fsfCUDtgDb83y7x+h3w6WA5Vt+F42aMoZ0Y+ 2xg47Rt9yK3Lt6G41BXPE6lLj3vtjp/zErallPiLGfbhXRHIBMPeUr6N/uXk7i2U8NGw=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Reply-To: References:Subject:List-Unsubscribe:List-Id:Cc:To:Date:From:Sender:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help:List-Subscribe:List-Post: List-Owner:List-Archive; bh=p8Va3BaBJzhL4treDtSK3zAViq6hJ+0t/1wHsYup1b8=; b=T ke8SJIfS0m7BOd7/+UsHwcCW7AKpFA9TkDQOsY+dPTXog3HLKlDu+zQdaBI/Ivh5c5XfhPmKDNezk PUceBg7EQtebso1/8jD6ql1OlvRKy2duh2bNhUcFT7Dd9QLeMyLiDN3UtZFB1UqR6i0DuMr1VtimZ p/Z/qZ19lR/3zcho=; Received: from mail-wm1-f49.google.com ([209.85.128.49]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1sqZl8-0005Zq-OT for openvpn-devel@lists.sourceforge.net; Tue, 17 Sep 2024 15:04:56 +0000 Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-42ca6ba750eso37042835e9.0 for ; Tue, 17 Sep 2024 08:04:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1726585483; x=1727190283; darn=lists.sourceforge.net; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from:from:to:cc :subject:date:message-id:reply-to; bh=p8Va3BaBJzhL4treDtSK3zAViq6hJ+0t/1wHsYup1b8=; b=Z98Bw5Ok3RTLzI8pxC1FdkpsY3kEBzkVn46x+otmSzk/JiQtKRdO90lAraIaZpgynO AUmoowCAnWsdjPfrJkUXYHVbmWjYSrDFqE5wZr01HtUIWS5bUzRhTywbLxL6NqrvbOqD U8Og1UTTJwa9dCxaTv+fw0knmSELMab3RXcMc5igvN4MQNLA9nvuGB5iv6q2s/ChVNk/ 1NxFoTYOVw/GKa2Yd11eIXv82ctSc5JiofpHNY55QJsNood6btDG1N7czrFoPpatqi3h Ur5ScDBbj0vbCjBl2fTckJ+mCspRupVu7A5CbPEfSGYhEe/D26isWb++1oIa6UXHslTr lm8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726585483; x=1727190283; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=p8Va3BaBJzhL4treDtSK3zAViq6hJ+0t/1wHsYup1b8=; b=Kr5Dptk16uv1XdJlyaSsOs1PdkQa52xmKqfRwWubZMyvKhkql4Y2FjH4owmss0aDJt /MuWnMBqffTQpZcQguL/iK3OY/+bIHCtJoe1nWu1jBA5YrIrMWDtDABH8Q7TwQ7E2itn +h5X1d6UnBhxySogrUDpXYFl7C/ZtOC/XQUcdx5BYFM7YZ9kQRFHCIFuQ9AYEQWc33cm iK9l90hwBwc0/Wh2uMbbBLvfSqXIz8SfLk4+AlLVoC0s2Vj5wX2EyRWUJCfvDFpwtbad wfWsM9VSqRV8nAYHNsDWjp3hS1H6GJE891G5LkxknX8Y7r56t0TN+DOe/tSzv1ME454v bd+Q== X-Gm-Message-State: AOJu0YyLYKBDQxuUX+PTilY4b8ZzMlhEAi4NBrAEBTqEj47/1jEuTfEw q4LuM5p08MfpTC9QBuBjkuKGS+l1iA4usBj1BPSyCh+0DpsFJSSguPt6Hx9xRMfhWoRDoys9jPD x X-Received: by 2002:a05:600c:3555:b0:426:5e32:4857 with SMTP id 5b1f17b1804b1-42cdbf44f4fmr115209695e9.0.1726585482598; Tue, 17 Sep 2024 08:04:42 -0700 (PDT) Received: from gerrit.openvpn.in (ec2-18-159-0-78.eu-central-1.compute.amazonaws.com. [18.159.0.78]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e62989024sm57986775e9.36.2024.09.17.08.04.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2024 08:04:42 -0700 (PDT) From: "plaisthos (Code Review)" X-Google-Original-From: "plaisthos (Code Review)" X-Gerrit-PatchSet: 1 Date: Tue, 17 Sep 2024 15:04:41 +0000 To: flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: I43d84034f3e920a45731c4aab4f851a60921290d X-Gerrit-Change-Number: 751 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: f0b8dc7b69690bff5ad2790aa2b4a6e514f1ea1a References: Message-ID: MIME-Version: 1.0 User-Agent: Gerrit/3.8.2 X-Spam-Score: -1.2 (-) X-Spam-Report: Spam detection software, running on the system "util-spamd-2.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit Content analysis details: (-1.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.49 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.128.49 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP 0.0 HTML_MESSAGE BODY: HTML included in message -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1sqZl8-0005Zq-OT Subject: [Openvpn-devel] [M] Change in openvpn[master]: Add building/testing with msbuild and the clang compiler X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: arne-openvpn@rfc2549.org, openvpn-devel@lists.sourceforge.net, frank@lichtenheld.com Cc: openvpn-devel Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1810456128377067347?= X-GMAIL-MSGID: =?utf-8?q?1810456128377067347?= X-getmail-filter-classifier: gerrit message type newchange Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/751?usp=email to review the following change. Change subject: Add building/testing with msbuild and the clang compiler ...................................................................... Add building/testing with msbuild and the clang compiler The LLVM/clang compiler warning and error message are easier too read than their MSVC cl counterparts. Also compiling/running tests on Windows with a different compiler has the benefit of a better coverage. This includes a few minor changes to allow clang-cl to compile the project. Change-Id: I43d84034f3e920a45731c4aab4f851a60921290d Signed-off-by: Arne Schwabe --- M .github/workflows/build.yaml M CMakeLists.txt M CMakePresets.json M config.h.cmake.in M src/openvpnmsica/openvpnmsica.c M src/openvpnmsica/openvpnmsica.h 6 files changed, 75 insertions(+), 14 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/51/751/1 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 361d457..d326937 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -272,7 +272,7 @@ strategy: fail-fast: false matrix: - arch: [amd64, x86, arm64] + arch: [amd64, x86, arm64, amd64-clang, x86-clang] name: "msbuild - ${{ matrix.arch }} - openssl" env: diff --git a/CMakeLists.txt b/CMakeLists.txt index 6271574..a841590 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -624,7 +624,8 @@ check_linker_flag(C -Wl,--wrap=parse_line LD_SUPPORTS_WRAP) endif() - if (${LD_SUPPORTS_WRAP}) + # Clang-cl (which is also MSVC) is wrongly detected to support wrap + if (NOT MSVC AND "${LD_SUPPORTS_WRAP}") list(APPEND unit_tests "test_argv" "test_tls_crypt" diff --git a/CMakePresets.json b/CMakePresets.json index 135b19d..b6ec201 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -122,6 +122,10 @@ } }, { + "name": "clangtoolset", + "toolset": "ClangCL" + }, + { "name": "mingw-x64", "inherits": [ "base", "base-mingw", "x64-mingw" ] }, @@ -134,6 +138,10 @@ "inherits": [ "base", "base-windows", "x64", "release" ] }, { + "name": "win-amd64-clang-release", + "inherits": [ "base", "base-windows", "clangtoolset", "x64", "release" ] + }, + { "name": "win-arm64-release", "inherits": [ "base", "base-windows", "arm64", "release" ] }, @@ -142,10 +150,18 @@ "inherits": [ "base", "base-windows", "x86", "release" ] }, { + "name": "win-x86-clang-release", + "inherits": [ "base", "base-windows", "clangtoolset", "x86", "release" ] + }, + { "name": "win-amd64-debug", "inherits": [ "base", "base-windows", "x64", "debug" ] }, { + "name": "win-amd64-clang-debug", + "inherits": [ "base", "base-windows", "clangtoolset", "x64", "debug" ] + }, + { "name": "win-arm64-debug", "inherits": [ "base", "base-windows", "arm64", "debug" ] }, @@ -154,6 +170,10 @@ "inherits": [ "base", "base-windows", "x86", "debug" ] }, { + "name": "win-x86-clang-debug", + "inherits": [ "base", "base-windows", "clangtoolset", "x86", "debug" ] + }, + { "name": "unix-native", "generator": "Ninja Multi-Config", "binaryDir": "out/build/unix" @@ -174,6 +194,11 @@ "configuration": "Release" }, { + "name": "win-amd64-clang-release", + "configurePreset": "win-amd64-clang-release", + "configuration": "Release" + }, + { "name": "win-arm64-release", "configurePreset": "win-arm64-release", "configuration": "Release" @@ -184,11 +209,21 @@ "configuration": "Release" }, { + "name": "win-x86-clang-release", + "configurePreset": "win-x86-clang-release", + "configuration": "Release" + }, + { "name": "win-amd64-debug", "configurePreset": "win-amd64-debug", "configuration": "Debug" }, { + "name": "win-amd64-clang-debug", + "configurePreset": "win-amd64-clang-debug", + "configuration": "Debug" + }, + { "name": "win-arm64-debug", "configurePreset": "win-arm64-debug", "configuration": "Debug" @@ -199,6 +234,11 @@ "configuration": "Debug" }, { + "name": "win-x86-clang-debug", + "configurePreset": "win-x86-clang-debug", + "configuration": "Debug" + }, + { "name": "unix-native", "configurePreset": "unix-native" } @@ -209,18 +249,34 @@ "configurePreset": "win-amd64-release" }, { + "name": "win-amd64-clang-release", + "configurePreset": "win-amd64-clang-release" + }, + { "name": "win-x86-release", "configurePreset": "win-x86-release" }, { + "name": "win-x86-clang-release", + "configurePreset": "win-x86-clang-release" + }, + { "name": "win-amd64-debug", "configurePreset": "win-amd64-debug" }, { + "name": "win-amd64-clang-debug", + "configurePreset": "win-amd64-clang-debug" + }, + { "name": "win-x86-debug", "configurePreset": "win-x86-debug" }, { + "name": "win-x86-clang-debug", + "configurePreset": "win-x86-clang-debug" + }, + { "name": "unix-native", "configurePreset": "unix-native" } diff --git a/config.h.cmake.in b/config.h.cmake.in index 18af5e9..724da2e 100644 --- a/config.h.cmake.in +++ b/config.h.cmake.in @@ -442,8 +442,10 @@ # define _GNU_SOURCE 1 #endif - -#if defined(_WIN32) +/* 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 typedef uint32_t in_addr_t; typedef uint16_t in_port_t; @@ -455,7 +457,7 @@ #define SIGTERM 15 #endif -#if defined(_MSC_VER) +#if defined(_MSC_VER) && !defined(RC_INVOKED) #include typedef SSIZE_T ssize_t; #define strncasecmp strnicmp diff --git a/src/openvpnmsica/openvpnmsica.c b/src/openvpnmsica/openvpnmsica.c index 5ffb5b3..4517f51 100644 --- a/src/openvpnmsica/openvpnmsica.c +++ b/src/openvpnmsica/openvpnmsica.c @@ -300,7 +300,7 @@ UINT __stdcall FindSystemInfo(_In_ MSIHANDLE hInstall) { -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) #pragma comment(linker, DLLEXP_EXPORT) #endif @@ -337,7 +337,7 @@ UINT __stdcall CloseOpenVPNGUI(_In_ MSIHANDLE hInstall) { -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) #pragma comment(linker, DLLEXP_EXPORT) #endif UNREFERENCED_PARAMETER(hInstall); /* This CA is does not interact with MSI session (report errors, access properties, tables, etc.). */ @@ -360,7 +360,7 @@ UINT __stdcall StartOpenVPNGUI(_In_ MSIHANDLE hInstall) { -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) #pragma comment(linker, DLLEXP_EXPORT) #endif @@ -633,7 +633,7 @@ UINT __stdcall EvaluateTUNTAPAdapters(_In_ MSIHANDLE hInstall) { -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) #pragma comment(linker, DLLEXP_EXPORT) #endif @@ -786,7 +786,7 @@ { goto cleanup_szDisplayName; } -#ifdef __GNUC__ +#if defined(__GNUC__) || defined(__clang__) /* * warning: enumeration value ‘MSICONDITION_TRUE’ not handled in switch * warning: enumeration value ‘MSICONDITION_NONE’ not handled in switch @@ -806,7 +806,7 @@ free(szValue); goto cleanup_szDisplayName; } -#ifdef __GNUC__ +#if defined(__GNUC__) || defined(__clang__) #pragma GCC diagnostic pop #endif free(szValue); @@ -962,7 +962,7 @@ UINT __stdcall ProcessDeferredAction(_In_ MSIHANDLE hInstall) { -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) #pragma comment(linker, DLLEXP_EXPORT) #endif @@ -1162,7 +1162,7 @@ UINT __stdcall CheckAndScheduleReboot(_In_ MSIHANDLE hInstall) { -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) #pragma comment(linker, DLLEXP_EXPORT) #endif diff --git a/src/openvpnmsica/openvpnmsica.h b/src/openvpnmsica/openvpnmsica.h index 6640d7e..88780e8 100644 --- a/src/openvpnmsica/openvpnmsica.h +++ b/src/openvpnmsica/openvpnmsica.h @@ -66,7 +66,9 @@ extern "C" { #endif -#ifdef __GNUC__ +/* Ensure that clang-cl, which does not understand the #pragma comment(linker, ...) + * is handled the same way as mingw */ +#if defined(__GNUC__) || defined(__clang__) #define DLLEXP_DECL __declspec(dllexport) #else #define DLLEXP_DECL