Skip to content

Commit

Permalink
- Use srand/rand instead of srandom/srand on non-POSIX platforms
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@11840 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed May 3, 2012
1 parent 677e97b commit 318847e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion SimulationRuntime/c/omc_msvc.h
Expand Up @@ -47,7 +47,9 @@ static union MSVC_FLOAT_HACK __NAN = {{0x00, 0x00, 0xC0, 0x7F}};
#define NAN (__NAN.Value)
#endif

/* Compatibility header for MSVC compiler */
/* Compatibility header for MSVC compiler.
* (Things that MinGW has but MSVC does not)
*/
#if defined(_MSC_VER)
#ifndef WIN32
#define WIN32
Expand All @@ -56,6 +58,8 @@ static union MSVC_FLOAT_HACK __NAN = {{0x00, 0x00, 0xC0, 0x7F}};
#define fmax(x, y) ((x>y)?x:y)
#define fmin(x, y) ((x<y)?x:y)
#define snprintf sprintf_s
#define srandom srand
#define random rand
#endif

#define round(dbl) (dbl >= 0.0 ? (int)(dbl + 0.5) : ((dbl - (double)(int)dbl) <= -0.5 ? (int)dbl : (int)(dbl - 0.5)))
Expand Down

0 comments on commit 318847e

Please sign in to comment.