libfacade 1.1
A library for manipulating PNG images with payloads.
Loading...
Searching...
No Matches
platform.hpp
Go to the documentation of this file.
1#ifndef __FACADE_PLATFORM_HPP
2#define __FACADE_PLATFORM_HPP
3
26
27#if defined(_WIN32) || defined(WIN32)
28#define LIBFACADE_WIN32
29#endif
30
31#if defined(LIBFACADE_SHARED)
32
33#if defined(LIBFACADE_WIN32)
34
35#if defined(LIBFACADE_EXPORT)
36#define EXPORT __declspec(dllexport)
37#else
38#define EXPORT __declspec(dllimport)
39#endif
40
41#else
42#define EXPORT __attribute__((visibility("default")))
43#endif
44
45#else
46#define EXPORT
47#endif
48
49#if defined(LIBFACADE_WIN32)
50#define PACK(alignment) __pragma(pack(push, alignment))
51#define UNPACK() __pragma(pack(pop))
52#else
53#define PACK(alignment) __attribute__((packed,aligned(alignment)))
54#define UNPACK()
55#endif
56
57#if defined(LIBFACADE_WIN32)
58/* this warning is in relation to a right-shift of 64, which is expected to result in a 0 value. */
59#pragma warning( disable: 4293 )
60
61/* this warning is in relation to a zero-sized array within a union, which works fine across the compilers we're targetting. */
62#pragma warning( disable: 4200 )
63#else
64/* this warning is in relation to a right-shift of 64, which is expected to result in a 0 value. */
65#pragma GCC diagnostic ignored "-Wshift-count-overflow"
66#endif
67
68#endif