Skip to content

Commit

Permalink
Guard open_memstream better
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@19792 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Mar 26, 2014
1 parent 471dd61 commit f16bc7d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Compiler/boot/include/msgpack-modelica.h
Expand Up @@ -216,7 +216,7 @@ static void* msgpack_modelica_new_stream(const char *filename)
#if HAVE_OPEN_MEMSTREAM
st->fout = open_memstream(&st->str,&st->size);
#else
ModelicaFormatError("String streams are not implemented for this platform");
ModelicaError("String streams are not implemented for this platform");
#endif
} else {
st->fout = fopen(filename, "wb");
Expand All @@ -238,6 +238,7 @@ static inline void msgpack_modelica_free_stream(void *ptr)

static char* msgpack_modelica_stream_get(void *ptr)
{
#if HAVE_OPEN_MEMSTREAM
char *res;
s_stream *st = (s_stream *) ptr;
if (!st->isStringBuffer) {
Expand All @@ -254,6 +255,9 @@ static char* msgpack_modelica_stream_get(void *ptr)
st->size = 0;
st->fout = open_memstream(&st->str,&st->size);
return res;
#else
ModelicaError("String streams are not implemented for this platform");
#endif
}

static inline void msgpack_modelica_stream_append(void *ptr, const char *str)
Expand Down

0 comments on commit f16bc7d

Please sign in to comment.