Skip to content

Commit

Permalink
fix MSVC build after adding of omc_file.c|h
Browse files Browse the repository at this point in the history
- fix the msvc part of omc_file.h
  • Loading branch information
adrpo committed Jun 6, 2019
1 parent a0cd154 commit 3134605
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions OMCompiler/SimulationRuntime/c/util/CMakeLists.txt
@@ -1,12 +1,12 @@
# Quellen und Header
SET(util_sources base_array.c boolean_array.c omc_error.c division.c index_spec.c
SET(util_sources base_array.c boolean_array.c omc_file.c omc_error.c division.c index_spec.c
integer_array.c java_interface.c libcsv.c list.c modelica_string.c
read_write.c read_matlab4.c read_csv.c real_array.c ringbuffer.c rational.c
rtclock.c simulation_options.c string_array.c utility.c varinfo.c omc_msvc.c OldModelicaTables.c omc_mmap.c
ModelicaUtilities.c modelica_string_lit.c omc_init.c write_csv.c ../gc/memory_pool.c)


SET(util_headers base_array.h boolean_array.h division.h omc_error.h index_spec.h integer_array.h
SET(util_headers base_array.h boolean_array.h division.h omc_file.h omc_error.h index_spec.h integer_array.h
java_interface.h jni.h jni_md.h jni_md_solaris.h jni_md_windows.h list.h
modelica.h modelica_string.h read_write.h read_matlab4.h real_array.h rational.h
ringbuffer.h rtclock.h simulation_options.h string_array.h utility.h varinfo.h omc_mmap.h
Expand Down
6 changes: 3 additions & 3 deletions OMCompiler/SimulationRuntime/c/util/omc_file.h
Expand Up @@ -58,15 +58,15 @@ extern "C" {
#if defined(_MSC_VER)

#ifndef MULTIBYTE_TO_WIDECHAR_VAR
#define MULTIBYTE_TO_WIDECHAR_VAR(string, unicodeString, unicodeLength) wchar_t *unicodeString = (wchar_t)malloc(unicodeLength*sizeof(wchar_t)); MultiByteToWideChar(CP_UTF8, 0, string, -1, unicodeString, unicodeLength)
#define MULTIBYTE_TO_WIDECHAR_VAR(string, unicodeString, unicodeLength) wchar_t *unicodeString = (wchar_t*)malloc(unicodeLength*sizeof(wchar_t)); MultiByteToWideChar(CP_UTF8, 0, string, -1, unicodeString, unicodeLength)
#endif

#ifndef WIDECHAR_TO_MULTIBYTE_VAR
#define WIDECHAR_TO_MULTIBYTE_VAR(unicode, string, stringLength) char *string = (char)malloc(stringLength*sizeof(char)); WideCharToMultiByte(CP_UTF8, 0, unicode, -1, string, stringLength, NULL, NULL)
#define WIDECHAR_TO_MULTIBYTE_VAR(unicode, string, stringLength) char *string = (char*)malloc(stringLength*sizeof(char)); WideCharToMultiByte(CP_UTF8, 0, unicode, -1, string, stringLength, NULL, NULL)
#endif

#ifndef MULTIBYTE_OR_WIDECHAR_VAR_FREE
#define MULTIBYTE_TO_WIDECHAR_VAR_FREE(unicodeString) if (unicodeString) { free(unicodeString); }
#define MULTIBYTE_OR_WIDECHAR_VAR_FREE(unicodeString) if (unicodeString) { free(unicodeString); }
#endif

#else /* mingw */
Expand Down

0 comments on commit 3134605

Please sign in to comment.