.TH "macros.hpp" 3 "Sat Aug 29 2026 00:42:30" "cereal" \" -*- nroff -*- .ad l .nh .SH NAME macros.hpp \- Preprocessor macros that can customise the cereal library\&. .SH SYNOPSIS .br .PP .SS "Macros" .in +1c .ti -1c .RI "#define \fBCEREAL_THREAD_SAFE\fP 0" .br .RI "Whether cereal should be compiled for a threaded environment\&. " .ti -1c .RI "#define \fBCEREAL_SIZE_TYPE\fP uint64_t" .br .RI "Determines the data type used for size_type\&. " .ti -1c .RI "#define \fBCEREAL_SERIALIZE_FUNCTION_NAME\fP serialize" .br .RI "The serialization/deserialization function name to search for\&. " .ti -1c .RI "#define \fBCEREAL_LOAD_FUNCTION_NAME\fP load" .br .RI "The deserialization (load) function name to search for\&. " .ti -1c .RI "#define \fBCEREAL_SAVE_FUNCTION_NAME\fP save" .br .RI "The serialization (save) function name to search for\&. " .ti -1c .RI "#define \fBCEREAL_LOAD_MINIMAL_FUNCTION_NAME\fP load_minimal" .br .RI "The deserialization (load_minimal) function name to search for\&. " .ti -1c .RI "#define \fBCEREAL_SAVE_MINIMAL_FUNCTION_NAME\fP save_minimal" .br .RI "The serialization (save_minimal) function name to search for\&. " .ti -1c .RI "#define \fBCEREAL_NOEXCEPT\fP" .br .RI "Defines the CEREAL_NOEXCEPT macro to use instead of noexcept\&. " .ti -1c .RI "#define \fBCEREAL_ALIGNOF\fP alignof" .br .RI "Checks if C++14 is available\&. " .in -1c .SH "Detailed Description" .PP Preprocessor macros that can customise the cereal library\&. By default, cereal looks for serialization functions with very specific names, that is: serialize, load, save, load_minimal, or save_minimal\&. .PP This file allows an advanced user to change these names to conform to some other style or preference\&. This is implemented using preprocessor macros\&. .PP As a result of this, in internal cereal code you will see macros used for these function names\&. In user code, you should name the functions like you normally would and not use the macros to improve readability\&. .SH "Macro Definition Documentation" .PP .SS "#define CEREAL_ALIGNOF alignof" .PP Checks if C++14 is available\&. Checks if C++17 is available NOTE: clang v5 has a bug with inline variables, so disable C++17 on that compiler Defines the CEREAL_ALIGNOF macro to use instead of alignof .SS "#define CEREAL_LOAD_FUNCTION_NAME load" .PP The deserialization (load) function name to search for\&. You can define \fRCEREAL_LOAD_FUNCTION_NAME\fP to be different assuming you do so before this file is included\&. .SS "#define CEREAL_LOAD_MINIMAL_FUNCTION_NAME load_minimal" .PP The deserialization (load_minimal) function name to search for\&. You can define \fRCEREAL_LOAD_MINIMAL_FUNCTION_NAME\fP to be different assuming you do so before this file is included\&. .SS "#define CEREAL_NOEXCEPT" .PP Defines the CEREAL_NOEXCEPT macro to use instead of noexcept\&. If a compiler we support does not support noexcept, this macro will detect this and define CEREAL_NOEXCEPT as a no-op .SS "#define CEREAL_SAVE_FUNCTION_NAME save" .PP The serialization (save) function name to search for\&. You can define \fRCEREAL_SAVE_FUNCTION_NAME\fP to be different assuming you do so before this file is included\&. .SS "#define CEREAL_SAVE_MINIMAL_FUNCTION_NAME save_minimal" .PP The serialization (save_minimal) function name to search for\&. You can define \fRCEREAL_SAVE_MINIMAL_FUNCTION_NAME\fP to be different assuming you do so before this file is included\&. .SS "#define CEREAL_SERIALIZE_FUNCTION_NAME serialize" .PP The serialization/deserialization function name to search for\&. You can define \fRCEREAL_SERIALIZE_FUNCTION_NAME\fP to be different assuming you do so before this file is included\&. .SS "#define CEREAL_SIZE_TYPE uint64_t" .PP Determines the data type used for size_type\&. cereal uses size_type to ensure that the serialized size of dynamic containers is compatible across different architectures (e\&.g\&. 32 vs 64 bit), which may use different underlying types for std::size_t\&. .PP More information can be found in \fBcereal/details/helpers\&.hpp\fP\&. .PP If you choose to modify this type, ensure that you use a fixed size type (e\&.g\&. uint32_t)\&. .SS "#define CEREAL_THREAD_SAFE 0" .PP Whether cereal should be compiled for a threaded environment\&. This macro causes cereal to use mutexes to control access to global internal state in a thread safe manner\&. .PP Note that even with this enabled you must still ensure that archives are accessed by only one thread at a time; it is safe to use multiple archives in parallel, but not to access one archive from many places simultaneously\&. .SH "Author" .PP Generated automatically by Doxygen for cereal from the source code\&.