From 0d384f83ae5b97bab4b6eae2b69c9c1847efc3fc Mon Sep 17 00:00:00 2001 From: LAGonauta Date: Mon, 4 May 2020 18:10:05 -0300 Subject: [PATCH] Added _WIN32 define to VALAC on Windows --- CMakeLists.txt | 4 ++++ libdino/src/service/util.vala | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5516dbdb..4b117f00 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -175,6 +175,10 @@ if (NOT NO_DEBUG) set(CMAKE_VALA_FLAGS "${CMAKE_VALA_FLAGS} -g") endif (NOT NO_DEBUG) +if (WIN32) + set(CMAKE_VALA_FLAGS "${CMAKE_VALA_FLAGS} --define=_WIN32") +endif(WIN32) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) diff --git a/libdino/src/service/util.vala b/libdino/src/service/util.vala index 9fe3029c..bb7198d3 100644 --- a/libdino/src/service/util.vala +++ b/libdino/src/service/util.vala @@ -29,7 +29,7 @@ public class Util { public static string get_content_type(FileInfo fileInfo) { -//#if WIN32 +#if _WIN32 string fileName = fileInfo.get_name(); int fileNameLength = fileName.length; int extIndex = fileName.index_of("."); @@ -42,8 +42,7 @@ public class Util { return mime_type; } } -//#endif - +#endif return fileInfo.get_content_type(); } }