Skip to content

Commit

Permalink
Compress Blosc: Fix MSVC Build
Browse files Browse the repository at this point in the history
Generalize packed data attributes.
  • Loading branch information
ax3l committed Jun 4, 2021
1 parent d0a2adf commit 7073d49
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion source/adios2/operator/compress/CompressBlosc.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@

#include "adios2/core/Operator.h"

#if defined(_MSC_VER)
#define ADIOS2_CLASS_PACKED(name) \
__pragma(pack(push, 1)) class name __pragma(pack(pop))
#else
#define ADIOS2_CLASS_PACKED(name) \
class __attribute__((packed)) name
#endif

namespace adios2
{
namespace core
Expand Down Expand Up @@ -77,7 +85,7 @@ class CompressBlosc : public Operator
void *dataOut, const size_t sizeOut,
Params &info) const;

class __attribute__((packed)) DataHeader
ADIOS2_CLASS_PACKED(DataHeader)
{
/** compatible to the first 4 byte of blosc header
*
Expand Down Expand Up @@ -116,4 +124,6 @@ class CompressBlosc : public Operator
} // end namespace core
} // end namespace adios2

#undef ADIOS2_CLASS_PACKED

#endif /* ADIOS2_OPERATOR_COMPRESS_COMPRESSBLOSC_H_ */

0 comments on commit 7073d49

Please sign in to comment.