Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
Define.h
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#ifndef SKYFIRE_DEFINE_H
7#define SKYFIRE_DEFINE_H
8
9#include "CompilerDefs.h"
10
11#include <cinttypes>
12#include <cstddef>
13#include <cstdint>
14
15#define SKYFIRE_LITTLEENDIAN 0
16#define SKYFIRE_BIGENDIAN 1
17
18#if !defined(SKYFIRE_ENDIAN)
19# if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
20# define SKYFIRE_ENDIAN SKYFIRE_BIGENDIAN
21# else
22# define SKYFIRE_ENDIAN SKYFIRE_LITTLEENDIAN
23# endif
24#endif //SKYFIRE_ENDIAN
25
26#if PLATFORM == PLATFORM_WINDOWS
27# define SKYFIRE_PATH_MAX MAX_PATH
28# ifndef DECLSPEC_NORETURN
29# define DECLSPEC_NORETURN __declspec(noreturn)
30# endif //DECLSPEC_NORETURN
31# ifndef DECLSPEC_DEPRECATED
32# define DECLSPEC_DEPRECATED __declspec(deprecated)
33# endif //DECLSPEC_DEPRECATED
34#else //PLATFORM != PLATFORM_WINDOWS
35# define SKYFIRE_PATH_MAX PATH_MAX
36# define DECLSPEC_NORETURN
37# define DECLSPEC_DEPRECATED
38#endif //PLATFORM
39
40#if !defined(COREDEBUG)
41# define SKYFIRE_INLINE inline
42#else //COREDEBUG
43# if !defined(SKYFIRE_DEBUG)
44# define SKYFIRE_DEBUG
45# endif //SKYFIRE_DEBUG
46# define SKYFIRE_INLINE
47#endif
48
49#if COMPILER == COMPILER_GNU
50# define ATTR_NORETURN __attribute__((noreturn))
51# define ATTR_PRINTF(F, V) __attribute__ ((format (printf, F, V)))
52# define ATTR_DEPRECATED __attribute__((deprecated))
53#else //COMPILER != COMPILER_GNU
54# define ATTR_NORETURN
55# define ATTR_PRINTF(F, V)
56# define ATTR_DEPRECATED
57#endif //COMPILER == COMPILER_GNU
58
59
60#define OVERRIDE override
61#define FINAL final
62
63
64#define UI64FMTD "%" PRIu64
65#define UI64LIT(N) UINT64_C(N)
66
67#define SI64FMTD "%" PRId64
68#define SI64LIT(N) INT64_C(N)
69
70#define SIZEFMTD "%zu"
71
72typedef std::int64_t int64;
73typedef std::int32_t int32;
74typedef std::int16_t int16;
75typedef std::int8_t int8;
76typedef std::uint64_t uint64;
77typedef std::uint32_t uint32;
78typedef std::uint16_t uint16;
79typedef std::uint8_t uint8;
80
82{
83 FT_NA = 'x', //not used or unknown, 4 byte size
84 FT_NA_BYTE = 'X', //not used or unknown, byte
85 FT_STRING = 's', //char*
86 FT_FLOAT = 'f', //float
87 FT_INT = 'i', //uint32
88 FT_BYTE = 'b', //uint8
89 FT_SORT = 'd', //sorted by this field, field is not included
90 FT_IND = 'n', //the same, but parsed to data
91 FT_SQL_PRESENT = 'p', //Used in sql format to mark column present in sql dbc
92 FT_SQL_ABSENT = 'a' //Used in sql format to mark column absent in sql dbc
93};
94
95#endif //SKYFIRE_DEFINE_H
std::int32_t int32
Definition Define.h:73
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
std::int8_t int8
Definition Define.h:75
DBCFormer
Definition Define.h:82
@ FT_IND
Definition Define.h:90
@ FT_NA
Definition Define.h:83
@ FT_FLOAT
Definition Define.h:86
@ FT_STRING
Definition Define.h:85
@ FT_SORT
Definition Define.h:89
@ FT_NA_BYTE
Definition Define.h:84
@ FT_INT
Definition Define.h:87
@ FT_BYTE
Definition Define.h:88
@ FT_SQL_ABSENT
Definition Define.h:92
@ FT_SQL_PRESENT
Definition Define.h:91
std::uint64_t uint64
Definition Define.h:76
std::int64_t int64
Definition Define.h:72
std::uint16_t uint16
Definition Define.h:78
std::int16_t int16
Definition Define.h:74