libragephoto Version: 0.7.1
Loading...
Searching...
No Matches
RagePhotoLibrary.h
1/*****************************************************************************
2* libragephoto RAGE Photo Parser
3* Copyright (C) 2023 Syping
4*
5* Redistribution and use in source and binary forms, with or without modification,
6* are permitted provided that the following conditions are met:
7*
8* 1. Redistributions of source code must retain the above copyright notice,
9* this list of conditions and the following disclaimer.
10*
11* 2. Redistributions in binary form must reproduce the above copyright notice,
12* this list of conditions and the following disclaimer in the documentation
13* and/or other materials provided with the distribution.
14*
15* This software is provided as-is, no warranties are given to you, we are not
16* responsible for anything with use of the software, you are self responsible.
17*****************************************************************************/
18
19#ifndef RAGEPHOTOLIBRARY_H
20#define RAGEPHOTOLIBRARY_H
21
22#include "RagePhotoConfig.h"
23
24/* RAGEPHOTO LIBRARY BINDING BEGIN */
25#ifdef _WIN32
26 #ifndef LIBRAGEPHOTO_STATIC
27 #ifdef LIBRAGEPHOTO_LIBRARY
28 #define LIBRAGEPHOTO_C_PUBLIC __declspec(dllexport)
29 #define LIBRAGEPHOTO_CXX_PUBLIC __declspec(dllexport)
30 #else
31 #define LIBRAGEPHOTO_C_PUBLIC __declspec(dllimport)
32 #define LIBRAGEPHOTO_CXX_PUBLIC __declspec(dllimport)
33 #endif // LIBRAGEPHOTO_LIBRARY
34 #else
35 #define LIBRAGEPHOTO_C_PUBLIC
36 #define LIBRAGEPHOTO_CXX_PUBLIC
37 #endif // LIBRAGEPHOTO_STATIC
38#else
39 #ifdef __EMSCRIPTEN__
40 #include <emscripten/emscripten.h>
41 #define LIBRAGEPHOTO_C_PUBLIC EMSCRIPTEN_KEEPALIVE
42 #define LIBRAGEPHOTO_CXX_PUBLIC
43 #else
44 #ifdef __GNUC__
45 #ifndef LIBRAGEPHOTO_STATIC
46 #define LIBRAGEPHOTO_C_PUBLIC __attribute__((visibility("default")))
47 #define LIBRAGEPHOTO_CXX_PUBLIC __attribute__((visibility("default")))
48 #else
49 #define LIBRAGEPHOTO_C_PUBLIC
50 #define LIBRAGEPHOTO_CXX_PUBLIC
51 #endif // LIBRAGEPHOTO_STATIC
52 #else
53 #define LIBRAGEPHOTO_C_PUBLIC
54 #define LIBRAGEPHOTO_CXX_PUBLIC
55 #endif // __GNUC__
56 #endif // __EMSCRIPTEN__
57#endif // _WIN32
58/* RAGEPHOTO LIBRARY BINDING END */
59
60/* RAGEPHOTO LIBRARY ENDIAN START */
61#if defined(_WIN32)
62 #define LIBRAGEPHOTO_LITTLE_ENDIAN
63#elif defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
64 #define LIBRAGEPHOTO_LITTLE_ENDIAN
65#elif defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && __BYTE_ORDER == __LITTLE_ENDIAN
66 #define LIBRAGEPHOTO_LITTLE_ENDIAN
67#elif defined(_BYTE_ORDER) && defined(_LITTLE_ENDIAN) && _BYTE_ORDER == _LITTLE_ENDIAN
68 #define LIBRAGEPHOTO_LITTLE_ENDIAN
69#elif defined(__APPLE__)
70 #include <machine/endian.h>
71 #if defined(__DARWIN_BYTE_ORDER) && defined(__DARWIN_LITTLE_ENDIAN) && __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN
72 #define LIBRAGEPHOTO_LITTLE_ENDIAN
73 #endif // __DARWIN_BYTE_ORDER
74#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
75 #include <sys/endian.h>
76 #if defined(_BYTE_ORDER) && defined(_LITTLE_ENDIAN) && _BYTE_ORDER == _LITTLE_ENDIAN
77 #define LIBRAGEPHOTO_LITTLE_ENDIAN
78 #endif // _BYTE_ORDER
79#elif defined(__linux__)
80 #include <endian.h>
81 #if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && __BYTE_ORDER == __LITTLE_ENDIAN
82 #define LIBRAGEPHOTO_LITTLE_ENDIAN
83 #endif // __BYTE_ORDER
84#endif
85/* RAGEPHOTO LIBRARY ENDIAN END */
86
87/* ENABLE C API FOR LIBRAGEPHOTO WASM LIBRARY BEGIN */
88#ifdef LIBRAGEPHOTO_WASM
89 #ifdef LIBRAGEPHOTO_CXX_ONLY
90 #undef LIBRAGEPHOTO_CXX_ONLY
91 #define LIBRAGEPHOTO_CXX_C
92 #endif // LIBRAGEPHOTO_CXX_ONLY
93#endif // LIBRAGEPHOTO_WASM
94/* ENABLE C API FOR LIBRAGEPHOTO WASM LIBRARY END */
95
96#endif // RAGEPHOTOLIBRARY_H