summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile6
-rw-r--r--meson.build6
-rw-r--r--platform.h7
3 files changed, 12 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 6de8f557d..31d40258d 100644
--- a/Makefile
+++ b/Makefile
@@ -192,6 +192,12 @@ $(call mark_unsupported,$(DEPENDS_ON_SERIAL))
$(call mark_unsupported,$(DEPENDS_ON_LIBUSB1) $(DEPENDS_ON_LIBFTDI) $(DEPENDS_ON_LIBJAYLINK))
endif
+ifeq ($(TARGET_OS), $(filter $(TARGET_OS), MinGW Cygwin))
+FEATURE_CFLAGS += -D'IS_WINDOWS=1'
+else
+FEATURE_CFLAGS += -D'IS_WINDOWS=0'
+endif
+
# FIXME: Should we check for Cygwin/MSVC as well?
ifeq ($(TARGET_OS), MinGW)
EXEC_SUFFIX := .exe
diff --git a/meson.build b/meson.build
index 02dedfcf9..a971a6a62 100644
--- a/meson.build
+++ b/meson.build
@@ -36,6 +36,12 @@ if host_machine.endian() == 'big'
add_project_arguments('-D__FLASHROM_BIG_ENDIAN__=1', language : 'c')
endif
+if host_machine.system() in ['cygwin', 'windows']
+ add_project_arguments('-DIS_WINDOWS=1', language : 'c')
+else
+ add_project_arguments('-DIS_WINDOWS=0', language : 'c')
+endif
+
# get defaults from configure
config_atahpt = get_option('config_atahpt')
config_atapromise = get_option('config_atapromise')
diff --git a/platform.h b/platform.h
index 34a56abc9..e0f8a7314 100644
--- a/platform.h
+++ b/platform.h
@@ -20,13 +20,6 @@
#ifndef __PLATFORM_H__
#define __PLATFORM_H__ 1
-// Helper defines for operating systems
-#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(__WINDOWS__)
-#define IS_WINDOWS 1
-#else
-#define IS_WINDOWS 0
-#endif
-
// Likewise for target architectures
#if defined (__i386__) || defined (__x86_64__) || defined(__amd64__)
#define IS_X86 1