From 584995aa38c95eefc7290249d81a9322a51af11f Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 28 Jan 2023 14:46:51 -0800 Subject: [PATCH] lib/uuid: remove unneeded Windows UUID workaround Some .c files in lib/uuid/ contain the following: #ifdef _WIN32 #define _WIN32_WINNT 0x0500 #include #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 Signed-off-by: Theodore Ts'o --- 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 67968db..daf30bb 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 a2225cc..2f02886 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 -#define UUID MYUUID -#endif #include #ifdef HAVE_UNISTD_H #include diff --git a/lib/uuid/tst_uuid.c b/lib/uuid/tst_uuid.c index 649bfbc..c1c2901 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 -#define UUID MYUUID -#endif - #include #include diff --git a/lib/uuid/uuid_time.c b/lib/uuid/uuid_time.c index af837a2..b519d3c 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 -#define UUID MYUUID -#endif - #include #ifdef HAVE_UNISTD_H #include -- 1.8.3.1