Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 325b392

Browse files
adrpoOpenModelica-Hudson
authored andcommitted
fix windows build
- include omc_msvc.h for attribute - exclude wsock2 as is already incldued - for some reason lst1 and lst2 are defined Belonging to [master]: - #2214
1 parent 74ad9da commit 325b392

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

Makefile.omdev.mingw

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ runtimeCPPmsvcinstall: mkbuilddirs CMinpack_msvc Umfpack_msvc fmil_msvc sundials
441441
cp -p $(BOOST_PATH_MSVC)/lib/*vc*.dll $(OMBUILDDIR)/bin/
442442
cp -p $(BOOST_PATH_MSVC)/lib/*vc*.lib $(OMBUILDDIR)/lib/omc/cpp/msvc
443443

444-
simulationruntimecmsvc: mkbuilddirs Umfpack_msvc CMinpack_msvc fmil_msvc sundials_msvc
444+
simulationruntimecmsvc: mkbuilddirs getMSVCversion Umfpack_msvc CMinpack_msvc fmil_msvc sundials_msvc
445445
test -f """${VSCOMNTOOLS}/../../VC/vcvarsall.bat"""
446446
mkdir -p $(OMBUILDDIR)/include/omc/msvc/
447447
mkdir -p $(OMBUILDDIR)/lib/omc/msvc/debug

SimulationRuntime/c/gc/omc_gc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ extern "C" {
5151

5252
#if defined(_MSC_VER)
5353
#include "omc_inline.h"
54+
#include "omc_msvc.h"
5455
#endif
5556

5657
typedef struct {

SimulationRuntime/c/meta/meta_modelica_builtin.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -422,29 +422,29 @@ void boxptr_listSetFirst(threadData_t *threadData, modelica_metatype cellToDestr
422422
MMC_CAR(cellToDestroy) = newContent;
423423
}
424424

425-
modelica_metatype listAppend(modelica_metatype lst1,modelica_metatype lst2)
425+
modelica_metatype listAppend(modelica_metatype l1,modelica_metatype l2)
426426
{
427427
int length = 0, i = 0;
428428
struct mmc_cons_struct *res = NULL;
429429
struct mmc_cons_struct *p = NULL;
430-
if (MMC_NILTEST(lst2)) /* If lst2 is empty, simply return lst1; huge performance gain for some uses of listAppend */
431-
return lst1;
432-
length = listLength(lst1);
433-
if (length == 0) /* We need to check for empty lst1 */
434-
return lst2;
430+
if (MMC_NILTEST(l2)) /* If l2 is empty, simply return l1; huge performance gain for some uses of listAppend */
431+
return l1;
432+
length = listLength(l1);
433+
if (length == 0) /* We need to check for empty l1 */
434+
return l2;
435435
res = (struct mmc_cons_struct*)mmc_alloc_words( length * 3 /*(sizeof(struct mmc_cons_struct)/sizeof(void*))*/ ); /* Do one single big alloc. It's cheaper */
436436
for (i=0; i<length-1; i++) { /* Write all except the last element... */
437437
struct mmc_cons_struct *p = res+i;
438438
p->header = MMC_STRUCTHDR(2, MMC_CONS_CTOR);
439-
p->data[0] = MMC_CAR(lst1);
439+
p->data[0] = MMC_CAR(l1);
440440
p->data[1] = MMC_TAGPTR(res+i+1);
441-
lst1 = MMC_CDR(lst1);
441+
l1 = MMC_CDR(l1);
442442
}
443-
/* The last element is a bit special. It points to lst2. */
443+
/* The last element is a bit special. It points to l2. */
444444
p = res+length-1;
445445
p->header = MMC_STRUCTHDR(2, MMC_CONS_CTOR);
446-
p->data[0] = MMC_CAR(lst1);
447-
p->data[1] = lst2;
446+
p->data[0] = MMC_CAR(l1);
447+
p->data[1] = l2;
448448
return MMC_TAGPTR(res);
449449
}
450450

SimulationRuntime/c/simulation/results/simulation_result_wall.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#include <assert.h>
4141

4242
#if defined(__MINGW32__) || defined(_MSC_VER)
43-
#include <winsock2.h> /* htonl */
43+
// #include <winsock2.h> /* htonl */
4444
#if defined(_MSC_VER)
4545
#include <stdint.h> /* for int32_t */
4646
#endif

0 commit comments

Comments
 (0)