[v2,1/3] include/binary-io.h: guard O_BINARY usage with defined check

Message ID 20250916001618.412638-1-andrew@andrewhanson.dev
State New
Headers
Series [v2,1/3] include/binary-io.h: guard O_BINARY usage with defined check |

Commit Message

Andrew Hanson Sept. 16, 2025, 12:16 a.m. UTC
  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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/include/binary-io.h b/include/binary-io.h
index 2f4be43a7c1..beeb0f76c25 100644
--- a/include/binary-io.h
+++ b/include/binary-io.h
@@ -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