Skip to content

Commit

Permalink
- attempt to fix windows build
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@20841 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed May 26, 2014
1 parent fc625e4 commit 768e0be
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 1 addition & 3 deletions SimulationRuntime/c/simulation/simulation_runtime.cpp
Expand Up @@ -28,9 +28,7 @@
*
*/

#ifdef _MSC_VER
#include <windows.h>
#endif
#include "omc_msvc.h"

#include <setjmp.h>
#include <string>
Expand Down
5 changes: 4 additions & 1 deletion SimulationRuntime/c/util/omc_msvc.c
Expand Up @@ -34,6 +34,9 @@
#include <stdlib.h>

#if defined(__MINGW32__) || defined(_MSC_VER)
#include <windows.h>
#include <time.h>

int asprintf(char **strp, const char *fmt, ...) {
int len;
va_list ap;
Expand Down Expand Up @@ -85,7 +88,7 @@ unsigned int alarm (unsigned int seconds)

pending = seconds;

if (nsec) {
if (seconds) {
time (&t0); // keep track of when count down started
DWORD threadId;
thread = CreateThread (0, 0, killProcess, (void*)seconds, 0, &threadId);
Expand Down
4 changes: 4 additions & 0 deletions SimulationRuntime/c/util/omc_msvc.h
Expand Up @@ -78,6 +78,10 @@ unsigned int alarm (unsigned int seconds);

#else /* not msvc */

#if defined(__MINGW32__)
unsigned int alarm (unsigned int seconds);
#endif

/* define inline for non-MSVC */
#define OMC_INLINE inline

Expand Down

0 comments on commit 768e0be

Please sign in to comment.