Added _WIN32 define to VALAC on Windows

This commit is contained in:
LAGonauta 2020-05-04 18:10:05 -03:00
parent 1841b348f1
commit 0d384f83ae
2 changed files with 6 additions and 3 deletions

View file

@ -175,6 +175,10 @@ if (NOT NO_DEBUG)
set(CMAKE_VALA_FLAGS "${CMAKE_VALA_FLAGS} -g") set(CMAKE_VALA_FLAGS "${CMAKE_VALA_FLAGS} -g")
endif (NOT NO_DEBUG) 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_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})

View file

@ -29,7 +29,7 @@ public class Util {
public static string get_content_type(FileInfo fileInfo) public static string get_content_type(FileInfo fileInfo)
{ {
//#if WIN32 #if _WIN32
string fileName = fileInfo.get_name(); string fileName = fileInfo.get_name();
int fileNameLength = fileName.length; int fileNameLength = fileName.length;
int extIndex = fileName.index_of("."); int extIndex = fileName.index_of(".");
@ -42,8 +42,7 @@ public class Util {
return mime_type; return mime_type;
} }
} }
//#endif #endif
return fileInfo.get_content_type(); return fileInfo.get_content_type();
} }
} }