JSON Voorhees
Killer JSON for C++
Loading...
Searching...
No Matches
Configuration

Macros

#define JSONV_VERSION_MAJOR   2
 The major version of JSON Voorhees these headers belong to.
 
#define JSONV_VERSION_MINOR   0
 The minor version of JSON Voorhees these headers belong to.
 
#define JSONV_VERSION_PATCH   0
 The patch version of JSON Voorhees these headers belong to.
 
#define JSONV_VERSION   (JSONV_VERSION_MAJOR * 1000000 + JSONV_VERSION_MINOR * 1000 + JSONV_VERSION_PATCH)
 The version of JSON Voorhees these headers belong to as a single number, JSONV_VERSION_MAJOR * 1000000 + JSONV_VERSION_MINOR * 1000 + JSONV_VERSION_PATCH, so a version check can be written as #if JSONV_VERSION >= 2000000.
 
#define JSONV_DEBUG   0
 Was JSON Voorhees compiled in debug mode? This value must be the same between when the SO was built and when you are compiling.
 
#define JSONV_SO   1
 Are you using shared objects (DLLs in Windows)?
 
#define JSONV_COMPILING   0
 Is JSON Voorhees currently compiling? You do not want to set this by hand.
 
#define JSONV_EXPORT
 If using shared objects, this class or function should be exported.
 
#define JSONV_IMPORT
 If using shared objects, this class or function should be imported.
 
#define JSONV_HIDDEN
 This symbol is only visible within the same shared object in which the translation unit will end up.
 
#define JSONV_PUBLIC   JSONV_IMPORT
 This function or class is part of the public API for JSON Voorhees.
 
#define JSONV_LOCAL   JSONV_HIDDEN
 This function or class is internal-use only.
 
#define JSONV_UNUSED   [[maybe_unused]]
 Note that you know the variable is unused, but make the compiler stop complaining about it.
 
#define JSONV_NODISCARD   [[nodiscard]]
 Warn if the caller discards the result of this function.
 
#define JSONV_NO_RETURN   [[noreturn]]
 Mark that a given function will never return control to the caller, either by exiting or throwing an exception.
 
#define JSONV_ALWAYS_INLINE
 Always inline the function this decorates, no matter what the compiler might think is best.
 
#define JSONV_INTEGER_ALTERNATES_LIST(item)
 An item list of types to also consider as an integer.
 
#define JSONV_LIKELY   [[likely]]
 Mark that a section of code is likely to be reached.
 
#define JSONV_UNLIKELY   [[unlikely]]
 Mark that a section of code is not likely to be reached.
 

Detailed Description

Macro Definition Documentation

◆ JSONV_ALWAYS_INLINE

#define JSONV_ALWAYS_INLINE

Always inline the function this decorates, no matter what the compiler might think is best.

Definition at line 148 of file config.hpp.

◆ JSONV_COMPILING

#define JSONV_COMPILING   0

Is JSON Voorhees currently compiling? You do not want to set this by hand.

It is set by the build system when the library is compiled.

Definition at line 63 of file config.hpp.

◆ JSONV_DEBUG

#define JSONV_DEBUG   0

Was JSON Voorhees compiled in debug mode? This value must be the same between when the SO was built and when you are compiling.

In general, this is not useful outside of library maintainers.

Warning
Keep in mind this value is always defined. Use #if JSONV_DEBUG, not #ifdef JSONV_DEBUG.

Definition at line 47 of file config.hpp.

◆ JSONV_EXPORT

#define JSONV_EXPORT

If using shared objects, this class or function should be exported.

Definition at line 96 of file config.hpp.

◆ JSONV_HIDDEN

#define JSONV_HIDDEN

This symbol is only visible within the same shared object in which the translation unit will end up.

Symbols which are "hidden" will not be put into the global offset table, which means code can be more optimal when it involves hidden symbols at the cost that nothing outside of the SO can access it.

Definition at line 98 of file config.hpp.

◆ JSONV_IMPORT

#define JSONV_IMPORT

If using shared objects, this class or function should be imported.

Definition at line 97 of file config.hpp.

◆ JSONV_INTEGER_ALTERNATES_LIST

#define JSONV_INTEGER_ALTERNATES_LIST (   item)
Value:
item(int) \
item(unsigned int) \
item(unsigned long) \
item(unsigned long long)

An item list of types to also consider as an integer.

This mostly exists to help resolve the C-induced type ambiguity for the literal 0. It most prefers to be an int, but might also become a long or a pointer type.

Definition at line 157 of file config.hpp.

◆ JSONV_LIKELY

#define JSONV_LIKELY   [[likely]]

Mark that a section of code is likely to be reached.

See also
JSONV_UNLIKELY

Definition at line 169 of file config.hpp.

◆ JSONV_LOCAL

#define JSONV_LOCAL   JSONV_HIDDEN

This function or class is internal-use only.

See also
JSONV_HIDDEN

Definition at line 114 of file config.hpp.

◆ JSONV_NO_RETURN

#define JSONV_NO_RETURN   [[noreturn]]

Mark that a given function will never return control to the caller, either by exiting or throwing an exception.

Definition at line 139 of file config.hpp.

◆ JSONV_NODISCARD

#define JSONV_NODISCARD   [[nodiscard]]

Warn if the caller discards the result of this function.

This decorates the side-effect-free parts of the API, where dropping the result means the call did nothing at all.

The guard checks JSONV_DOXYGEN as well as the usual ifndef because config/Doxyfile predefines this macro as empty to keep it out of the rendered signatures. That also hides this define from Doxygen, which then warns about documentation for a macro it never saw; re-entering the block for Doxygen alone keeps the two consistent. No compiler defines JSONV_DOXYGEN, so everywhere else this is exactly the ifndef its siblings use.

Definition at line 132 of file config.hpp.

◆ JSONV_PUBLIC

#define JSONV_PUBLIC   JSONV_IMPORT

This function or class is part of the public API for JSON Voorhees.

If you are including JsonVoorhees for another library, this will have import semantics (JSONV_IMPORT); if you are building JsonVoorhees, this will have export semantics (JSONV_EXPORT).

Definition at line 113 of file config.hpp.

◆ JSONV_SO

#define JSONV_SO   1

Are you using shared objects (DLLs in Windows)?

Definition at line 53 of file config.hpp.

◆ JSONV_UNLIKELY

#define JSONV_UNLIKELY   [[unlikely]]

Mark that a section of code is not likely to be reached.

See also
JSONV_LIKELY

Definition at line 177 of file config.hpp.

◆ JSONV_UNUSED

#define JSONV_UNUSED   [[maybe_unused]]

Note that you know the variable is unused, but make the compiler stop complaining about it.

Definition at line 120 of file config.hpp.

◆ JSONV_VERSION

#define JSONV_VERSION   (JSONV_VERSION_MAJOR * 1000000 + JSONV_VERSION_MINOR * 1000 + JSONV_VERSION_PATCH)

The version of JSON Voorhees these headers belong to as a single number, JSONV_VERSION_MAJOR * 1000000 + JSONV_VERSION_MINOR * 1000 + JSONV_VERSION_PATCH, so a version check can be written as #if JSONV_VERSION >= 2000000.

Definition at line 37 of file config.hpp.

◆ JSONV_VERSION_MAJOR

#define JSONV_VERSION_MAJOR   2

The major version of JSON Voorhees these headers belong to.

Definition at line 23 of file config.hpp.

◆ JSONV_VERSION_MINOR

#define JSONV_VERSION_MINOR   0

The minor version of JSON Voorhees these headers belong to.

Definition at line 27 of file config.hpp.

◆ JSONV_VERSION_PATCH

#define JSONV_VERSION_PATCH   0

The patch version of JSON Voorhees these headers belong to.

Definition at line 31 of file config.hpp.