]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Add member to cpu_features struct if empty
authorlawadr <3211473+lawadr@users.noreply.github.com>
Mon, 20 Mar 2023 17:46:35 +0000 (17:46 +0000)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Mon, 27 Mar 2023 18:06:07 +0000 (20:06 +0200)
When WITH_OPTIM is off, the cpu_features struct is empty. This is not
allowed in standard C and causes a build failure with various compilers,
including MSVC.

This adds a dummy char member to the struct if it would otherwise be
empty.

cpu_features.h

index 14eb19a751023d632922009f11db070db741fe81..462671a187ee264a01bcb8c86f1f5d1d7457f6c5 100644 (file)
@@ -29,6 +29,8 @@ struct cpu_features {
     struct power_cpu_features power;
 #elif defined(S390_FEATURES)
     struct s390_cpu_features s390;
+#else
+    char empty;
 #endif
 };