From: Eric Biggers <ebiggers@kernel.org>
To: linux-ext4@vger.kernel.org
Subject: [PATCH 4/4] lib/uuid: remove unneeded Windows UUID workaround
Date: Sat, 28 Jan 2023 14:46:51 -0800 [thread overview]
Message-ID: <20230128224651.59593-5-ebiggers@kernel.org> (raw)
In-Reply-To: <20230128224651.59593-1-ebiggers@kernel.org>
From: Eric Biggers <ebiggers@google.com>
Some .c files in lib/uuid/ contain the following:
#ifdef _WIN32
#define _WIN32_WINNT 0x0500
#include <windows.h>
#define UUID MYUUID
#endif
This seems to have been intended to allow the use of a local "UUID" type
without colliding with "UUID" in the Windows API. However, this is
unnecessary because there's no local "UUID" type -- there's only uuid_t.
None of these .c files need the include of windows.h, either.
Finally, the unconditional definition of _WIN32_WINNT causes a compiler
warning when the user defines _WIN32_WINNT themself.
Since this code is unnecessary and is causing problems, just remove it.
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
lib/uuid/Android.bp | 2 --
lib/uuid/gen_uuid.c | 5 -----
lib/uuid/tst_uuid.c | 6 ------
lib/uuid/uuid_time.c | 6 ------
4 files changed, 19 deletions(-)
diff --git a/lib/uuid/Android.bp b/lib/uuid/Android.bp
index 67968dba3..daf30bb94 100644
--- a/lib/uuid/Android.bp
+++ b/lib/uuid/Android.bp
@@ -45,8 +45,6 @@ cc_library {
],
target: {
windows: {
- // Cannot suppress the _WIN32_WINNT redefined warning.
- cflags: ["-Wno-error"],
include_dirs: [ "external/e2fsprogs/include/mingw" ],
enabled: true
},
diff --git a/lib/uuid/gen_uuid.c b/lib/uuid/gen_uuid.c
index a2225ccee..2f028867a 100644
--- a/lib/uuid/gen_uuid.c
+++ b/lib/uuid/gen_uuid.c
@@ -41,11 +41,6 @@
#include "config.h"
-#ifdef _WIN32
-#define _WIN32_WINNT 0x0500
-#include <windows.h>
-#define UUID MYUUID
-#endif
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
diff --git a/lib/uuid/tst_uuid.c b/lib/uuid/tst_uuid.c
index 649bfbc05..c1c290158 100644
--- a/lib/uuid/tst_uuid.c
+++ b/lib/uuid/tst_uuid.c
@@ -34,12 +34,6 @@
#include "config.h"
-#ifdef _WIN32
-#define _WIN32_WINNT 0x0500
-#include <windows.h>
-#define UUID MYUUID
-#endif
-
#include <stdio.h>
#include <stdlib.h>
diff --git a/lib/uuid/uuid_time.c b/lib/uuid/uuid_time.c
index af837a2ca..b519d3c4b 100644
--- a/lib/uuid/uuid_time.c
+++ b/lib/uuid/uuid_time.c
@@ -36,12 +36,6 @@
#include "config.h"
-#ifdef _WIN32
-#define _WIN32_WINNT 0x0500
-#include <windows.h>
-#define UUID MYUUID
-#endif
-
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
--
2.39.1
next prev parent reply other threads:[~2023-01-28 22:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-28 22:46 [PATCH 0/4] e2fsprogs: a few more warning fixes Eric Biggers
2023-01-28 22:46 ` [PATCH 1/4] ci.yml: ensure -Werror really gets used in all cases Eric Biggers
2023-01-30 5:07 ` Theodore Ts'o
2023-01-28 22:46 ` [PATCH 2/4] debugfs: fix a -Wformat warning in dump_journal() Eric Biggers
2023-01-30 5:08 ` Theodore Ts'o
2023-01-28 22:46 ` [PATCH 3/4] lib/ext2fs: don't warn about lack of getmntent on Windows Eric Biggers
2023-01-30 5:08 ` Theodore Ts'o
2023-01-28 22:46 ` Eric Biggers [this message]
2023-01-30 5:09 ` [PATCH 4/4] lib/uuid: remove unneeded Windows UUID workaround Theodore Ts'o
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230128224651.59593-5-ebiggers@kernel.org \
--to=ebiggers@kernel.org \
--cc=linux-ext4@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).