Platform identification |
![]() |
Str Library needs to know the platform on which it is running. Thus, one of the following conditional symbols must be defined:
#define STR_WIN32 #define STR_LINUX
Defining STR_LINUX actually encompasses all platforms that are supported by gcc, have a conforming C runtime library and a 32-bit pointer type. When STR_LINUX is defined, one of the following should also be defined:
#define STR_BIG_ENDIAN #define STR_LITTLE_ENDIAN
Intel-based architectures are little endian.
In addition, the library needs to know whether this is a debug or a release build (performance improvement in release builds can be dramatic). Thus, one of these two symbols must be defined:
#define _DEBUG /* Debug mode, slower but with lots of error checking */ #define NDEBUG /* Release mode, highly optimized code, few error checks */
These symbols are standard for the Microsoft Visual C++ compiler but may need to be added manually to your makefile for gcc projects.
Other supported Windows environments (such as Windows with the Borland C++ compiler, or Windows CE) also need STR_WIN32 to be declared; Str Library will autodetect the particular compiler or target platform.
See also: Str conditional defines, Platform-specific notes