]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
include/binary-io.h: guard O_BINARY usage with defined check
authorAndrew Hanson <andrew@andrewhanson.dev>
Fri, 26 Sep 2025 10:22:17 +0000 (12:22 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 26 Sep 2025 10:22:17 +0000 (12:22 +0200)
include/

* binary-io.h: Fix -Wundef compiler warning when O_BINARY is not
defined. Wrap the check to ensure portability across platforms.

Signed-off-by: Andrew Hanson <andrew@andrewhanson.dev>
include/binary-io.h

index 2f4be43a7c17e6df6251cbd4ae154de0076140e8..beeb0f76c25a5fffe8c3d86a2bd312b00776159b 100644 (file)
@@ -35,7 +35,7 @@
 # undef O_BINARY
 # undef O_TEXT
 #endif
-#if O_BINARY
+#if defined(O_BINARY) && O_BINARY
 # if defined __EMX__ || defined __DJGPP__ || defined __CYGWIN__
 #  include <io.h> /* declares setmode() */
 # else