CSTR v1.0.0-build
Simple yet powerful string manipulation in C
Loading...
Searching...
No Matches
CSTRpredefines.h
Go to the documentation of this file.
1/**
2 * CSTRpredefines.h - pcannonProjectStandards
3 * Predefines for C and C++ projects
4 * STD Information: 20250723 - 1.0S
5 */
6
7#pragma once
8
9// Project setup
10#define CSTR_DEFAULT_C_STD 201112L
11
12// Versioning
13#define CSTR_VERSION_MAJOR 1
14#define CSTR_VERSION_MINOR 0
15#define CSTR_VERSION_PATCH 0
16
17#define CSTR_VERSION_STD 20251017
18
19// Version states:
20// * dev
21// * beta
22// * build
23#define CSTR_VERSION_STATE "build"
24
25#define CSTR_VERSION ((CSTR_VERSION_MAJOR<<16)|(CSTR_VERSION_MINOR<<8)|(CSTR_VERSION_PATCH)|(CSTR_VERSION_STATE << 24))
26
27#define CSTR_VERSION_CHECK(CSTR_VERSION_MAJOR, CSTR_VERSION_MINOR, CSTR_VERSION_PATCH, CSTR_VERSION_STATE) \
28 (((CSTR_VERSION_MAJOR)<<16)|((CSTR_VERSION_MINOR)<<8)|(CSTR_VERSION_PATCH)|((CSTR_VERSION_STATE) << 24))
29
30// Macro utils
31#define CSTR_STRINGIFY(x) #x
32#define CSTR_TOSTRING(x) CSTR_STRINGIFY(x)
33
34#ifndef CSTR_DEV
35# define CSTR_DEV true
36#endif
37
38#if _MSC_VER
39# error "Currently not available for MSVC compilers"
40#endif
41
42#ifdef WIN32
43# define CSTR_OS_WIN32
44# warning "No full support for Windows"
45#elif defined(__APPLE__) || defined(__MACH__) || defined(Macintosh)
46# define CSTR_OS_MACOS
47#elif defined(__linux__) || defined(__unix) || defined(__unix__)
48# define CSTR_OS_UNIX_LINUX
49#elif defined(__FreeBSD__)
50# define CSTR_OS_FREEBSD
51#else
52# warning "Current platform might not be supported"
53#endif // defined(WIN32) // Platform check
54