Skip to content

Commit

Permalink
fixing c++ wrapper build for MSVC and also fixing the byte-ordering b…
Browse files Browse the repository at this point in the history
…ug for double data in portablexdrlib for MSVC
  • Loading branch information
stephen-dixon committed Sep 13, 2024
1 parent fd71ebb commit a02d419
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions extlib/portablexdr-4.9.1/xdr_float.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ xdr_double(xdrs, dp)
id.sign = vd.sign;
lp = (long *)(void *)&id;
#endif
#if defined(__CYGWIN32__) || defined(__MINGW32__)
#if defined(__CYGWIN32__) || defined(__MINGW32__) || defined(_WIN32)
return (XDR_PUTLONG(xdrs, lp+1) && XDR_PUTLONG(xdrs, lp));
#else
return (XDR_PUTLONG(xdrs, lp++) && XDR_PUTLONG(xdrs, lp));
Expand All @@ -241,7 +241,7 @@ xdr_double(xdrs, dp)
case XDR_DECODE:
#if !defined(vax)
lp = (long *)dp;
#if defined(__CYGWIN32__) || defined(__MINGW32__)
#if defined(__CYGWIN32__) || defined(__MINGW32__) || defined(_WIN32)
return (XDR_GETLONG(xdrs, lp+1) && XDR_GETLONG(xdrs, lp));
#else
return (XDR_GETLONG(xdrs, lp++) && XDR_GETLONG(xdrs, lp));
Expand Down
2 changes: 1 addition & 1 deletion extlib/portablexdr-4.9.1/xdr_stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static char sccsid[] = "@(#)xdr_stdio.c 1.16 87/08/11 Copyr 1984 Sun Micro";

#include "byteswap.h"

#if defined(__CYGWIN32__) || defined(__MINGW32__)
#if defined(__CYGWIN32__) || defined(__MINGW32__) || defined(_WIN32)
#include <stdlib.h>
#include <fcntl.h>
unsigned int _CRT_fmode = _O_BINARY;
Expand Down
2 changes: 1 addition & 1 deletion source/wrappers/c++/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ if( WIN32 OR MINGW )
if( MINGW )
set( LINK_LIB ${LINK_LIB} ${XDR_LIBRARIES} ws2_32 dlfcn-win32::dl Iconv::Iconv liblzma::liblzma ZLIB::ZLIB crypt32 stdc++ )
else()
set( LINK_LIB ${LINK_LIB} ${XDR_LIBRARIES} ws2_32 dlfcn-win32::dl )
set( LINK_LIB ${LINK_LIB} ${XDR_LIBRARIES} ws2_32 crypt32 dlfcn-win32::dl )
endif()
elseif( TIRPC_FOUND )
set( LINK_LIB ${LINK_LIB} ${TIRPC_LIBRARIES} )
Expand Down
2 changes: 2 additions & 0 deletions source/wrappers/c++/structdata.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class LIBRARY_API StructData {
std::string tname = typeid(T).name();
#ifdef __GNUC__
std::string demangled_name(abi::__cxa_demangle(tname.c_str(), nullptr, nullptr, &status));
#elif _MSC_VER && !__INTEL_COMPILER
std::string demangled_name = tname;
#else
char demangled[1024];
UnDecorateSymbolName(tname, demangled, sizeof(demangled), UNDNAME_COMPLETE);
Expand Down

0 comments on commit a02d419

Please sign in to comment.