From patchwork Thu Dec 7 17:49:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "plaisthos (Code Review)" X-Patchwork-Id: 3505 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:8d12:b0:fc:24ac:f0cb with SMTP id i18csp3097800dys; Thu, 7 Dec 2023 09:50:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IHk8XOwuDpOA9d3o+naoCVlfS02dsL8euEvmeceO6NYqD52pSeGwBDAtYbM4yc4iTx4U829 X-Received: by 2002:a05:6a21:187:b0:18b:2020:8cd1 with SMTP id le7-20020a056a21018700b0018b20208cd1mr7046077pzb.3.1701971433083; Thu, 07 Dec 2023 09:50:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701971433; cv=none; d=google.com; s=arc-20160816; b=ocRMy59fwLPXQZxZBbmsS8l2Qap5Jjh1KyNEQbnoze78rQkf6Rn8PsNDaQZRiu9u9z GsKn0oC7RKScXwfJInyzDXB6LFNr3RRa/QyGSbbItmTjhsAiqxj4PtdYlTztUmvq4zib rwfBrRsbfC0Mlm1n1KmteiFveWNH1MaRASxbkFKJTsj5umvEoESzuEfeHlCKsDF6ezzd bIhhaGSMMM0FnjowwTQERqK7w4nKPhPPYCbj9lpGPXBG39Gv6vAwZXez3rbrqCDYkz/B 4tFW73PXI7uHgFuSQcKQtgLkoGs0Fi3E/SuyABIEFeYvu8rOWdqsicte8U117l67fxTl Imsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=TFug+5E2wMk9xGxeRCFNjxIYsA2XFmsyZCzzBS/iZoo=; fh=lm0MLPW7DntlrDqRECIiC9JlE1uPxhepE0URYHIf+eE=; b=mlHpFbNvADzNpe46miehpQrSTPv4/j7oklNwX9qhiPReEW9v6+g0wclaBFsvq4cCF9 KFjTDfL9pmdOB0KtOpy6hmYG6dn8fTeA0cKIp/7C82X4COUMmrn8/1Iuw2d2CjBsZNfD byT5zusRIOeWST1i4yOx10D1WRt6zlHG8fHYvFGNbMmSylF2MZGAUWR7V6PXqoHJIfHd zQbJ/uDc6LhwlvWVILlOxOKQJV6R5fPFwwS0k5oBcdJGC4L7RXfS4uhXXAYoHnZJ1mqj j/1WX6krTqFBM8T3heJ1Kl5y+L1Z9UcROT7UXF5d/BrFsZBhDAusiRHHWYGRUp0rF6+B pTYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=g5wPnCp7; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=HIyb2Qpq; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=CTH0t911; 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 Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id c13-20020a631c4d000000b005c65fe4373fsi56905pgm.315.2023.12.07.09.50.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Dec 2023 09:50:33 -0800 (PST) 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=g5wPnCp7; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=HIyb2Qpq; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=CTH0t911; 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 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1rBIVY-00061R-Fm; Thu, 07 Dec 2023 17:49:56 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rBIVX-00061K-Pl for openvpn-devel@lists.sourceforge.net; Thu, 07 Dec 2023 17:49: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=vNah5cz9+UgvFokY/S3IlAUKJTTNL1dJ5XqcznOGQ7o=; b=g5wPnCp7goZm8MKHWQImEEzeic 53OJhgbpD09UG+LyX0k+niOvgd76261UYLQBt5zixY0EEz7LKiSnBjn6VknAdwfsafklxmegSGGsl jwMw0YO3d9E75RPyUeUWT6PQMuqTdnMtM2VofLoW0EzgJrnZwBhjyq4G3j3bWtk+75oo=; 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=vNah5cz9+UgvFokY/S3IlAUKJTTNL1dJ5XqcznOGQ7o=; b=H Iyb2QpqNh8SL3FZejF3zjgQUUDSwCB56huJKoOthW+18NOojXwCRFIejJfie8xs19RWIYV9jfaCOs o4+81W+S4iliF0hY/fITD2tAcLKywEgQ/B0rdseBGke9VkgRwmMK3XNTOJIZ6JwJUV6Tsiqk8/Q4Y 6Tn1/xGGt5Fim1Uw=; Received: from mail-wr1-f42.google.com ([209.85.221.42]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1rBIVS-0005gi-Lb for openvpn-devel@lists.sourceforge.net; Thu, 07 Dec 2023 17:49:55 +0000 Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-3333b46f26aso1240050f8f.1 for ; Thu, 07 Dec 2023 09:49:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1701971382; x=1702576182; 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=vNah5cz9+UgvFokY/S3IlAUKJTTNL1dJ5XqcznOGQ7o=; b=CTH0t911fgbf5D02EoJGgCINwlB+MsCeMRazXyLlgCxgIwbs04ZwVvzWyfLqUHZNLv OWbNbXssg5bsU7KVIEYvqFaF8bj8L2H7+S1tNy7IcX2aR58VOcfZNbQ8nfhTvvaIAYl3 WA5/jeclSiD70SIC/bCVVXD8y8X0wWB0r2+Y7X4j2+7YuGscj5n6hcRIKWHlsuZYCubF ol3u0zlbhZBlSvDOZcRp5l4maKUBmrBpXITCv0CNX/+Te7M0dL6D6J6xMt+ZbubLh2II njI7rJwx0wDMVGK0rc/1CBwuGFprjBsBkdATHTH/4K4md5XlJiZ7UNZ8gFWpNRILONz2 Z8bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701971382; x=1702576182; 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=vNah5cz9+UgvFokY/S3IlAUKJTTNL1dJ5XqcznOGQ7o=; b=nFIjgRCnqJHOGUEVp23E9Ce8B5XYfDNYXWKx8Cb1DMAMGQGRnoN8SIBBrHkRM6hkf2 8LBWR5mDmbQHqtXcH2srzCQJT7fikEq54O4N0ZXX9hJa78oKwAWndEAHnNsszQ3uZT7E tWvb325CBAwJvdWVZ7OUbTaoj1uBM/kFwErEkW+aQXnITbmPujPqM/HKYnktjd26FoV1 zu45cRLiIe683rc00LfcZXhnyoPTNv0LQqYkxxy3Qil8eOcGFPo+H9hiM7SBW+iELKxB dNGSCQo8FevAx9VjdAFYftP0SYXvwLZJSUg174kyGThwfe2mt7dY5lG0urxJUiX0Ol98 Mv7Q== X-Gm-Message-State: AOJu0YywcG9iJiAskXwyvw3PXv1/iDEefrutL4JgPUkq1Whx0Fx3IqTo o8nVU2R4PKmo4GdedCsz1ZeLoUapj121zFpmmNc= X-Received: by 2002:a05:600c:1987:b0:40c:192f:eee3 with SMTP id t7-20020a05600c198700b0040c192feee3mr1724221wmq.86.1701971382332; Thu, 07 Dec 2023 09:49:42 -0800 (PST) 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 v7-20020a05600c444700b0040b461550c4sm2579415wmn.42.2023.12.07.09.49.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 09:49:41 -0800 (PST) From: "plaisthos (Code Review)" X-Google-Original-From: "plaisthos (Code Review)" X-Gerrit-PatchSet: 1 Date: Thu, 7 Dec 2023 17:49:41 +0000 To: flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: Ie5aa643ab6190262f7c8b9e614bedb398e85859b X-Gerrit-Change-Number: 469 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: 1a8d6dc3e15fb4cce4ffc1c92ca0a6587d07bde4 References: Message-ID: MIME-Version: 1.0 User-Agent: Gerrit/3.8.2 X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.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: (-0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.221.42 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.221.42 listed in wl.mailspike.net] -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_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. 0.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1rBIVS-0005gi-Lb Subject: [Openvpn-devel] [S] Change in openvpn[master]: Use mingw compile definition also to unit tests 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?1784646397532582510?= X-GMAIL-MSGID: =?utf-8?q?1784646397532582510?= 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/+/469?usp=email to review the following change. Change subject: Use mingw compile definition also to unit tests ...................................................................... Use mingw compile definition also to unit tests Currently we only apply the defines for windows APIs and Unicode to OpenVPN itself. We should rather treat the unit tests the same as our main binary to reduce potential differences. Change-Id: Ie5aa643ab6190262f7c8b9e614bedb398e85859b Signed-off-by: Arne Schwabe --- M CMakeLists.txt 1 file changed, 14 insertions(+), 8 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/69/469/1 diff --git a/CMakeLists.txt b/CMakeLists.txt index 577bc5d..8c24cca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -259,6 +259,15 @@ endif () + if (MINGW) + target_compile_options(${target} PRIVATE + -DWIN32_LEAN_AND_MEAN + -DNTDDI_VERSION=NTDDI_VISTA -D_WIN32_WINNT=_WIN32_WINNT_VISTA + ) + target_compile_options(${target} PRIVATE -municode -UUNICODE) + target_link_options(${target} PRIVATE -municode) + endif() + # optional dependencies target_link_libraries(${target} PUBLIC $ @@ -514,14 +523,6 @@ add_library_deps(openvpn) -if (MINGW) - target_compile_options(openvpn PRIVATE - -DWIN32_LEAN_AND_MEAN - -DNTDDI_VERSION=NTDDI_VISTA -D_WIN32_WINNT=_WIN32_WINNT_VISTA - ) - target_compile_options(openvpn PRIVATE -municode -UUNICODE) - target_link_options(openvpn PRIVATE -municode) -endif() if (MSVC) # we have our own manifest @@ -634,6 +635,11 @@ target_include_directories(${test_name} PRIVATE src/openvpn) + if (MINGW) + # when compiling with -municode, mingw looks for wmain instead of main + target_compile_definitions(${test_name} PRIVATE -Dmain=wmain) + endif () + if (NOT ${test_name} STREQUAL "test_buffer") target_sources(${test_name} PRIVATE src/openvpn/buffer.c