You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C, Cpp, CppCli, DspC, ECpp standards identification macros for C and C++
3rd edition of the library
part of the C83Project
support for 8.3 file naming conventions with the exception of the main include and code files
support CKR(K&R C) and higher editions
Overview
C83Standard is a lightweight, portable, header‑based C/C++ utility library
designed to detect the active language standard used by the compiler.
It supports strict 8.3 filename conventions, making it suitable for embedded systems,
legacy toolchains, DOS‑based environments, and cross‑platform builds.
Features
C language standards from CKR(K&R C) to C23
Detects hosted / freestanding C standard
C++ language standards from CPPPRE(pre-standard) to CPP23
C++ CLI language standards from CPPCLIPRE(pre-standard) to CPPCLI
Detects Embedded C++ mode
DSP‑C (reserved for future use)
Design Goals
Primary Objectives
Provide a unified, compiler‑agnostic way to detect language standards.
Work with old, modern, and embedded compilers.
Maintain 8.3 filename compatibility.
Avoid dependencies and remain header‑only (except for the version function).
Key Principles
Simplicity: Easy to integrate and use.
Predictability: All macros follow consistent naming conventions.
Portability: Works across GCC, Clang, MSVC, Turbo C++, and embedded compilers.
Minimalism: Only preprocessor logic, no runtime overhead except for version function.
Transparency: Exposes all detected values via simple macros.
Repository Structure
Filename
Description
C83Standard.h
Main include file, exposes version API
C83Standard.c
Implementation of version function
PC.h
C standard detection macros
PCpp.h
C++ standard detection macros
PCppCli.h
C++/CLI standard detection macros
PDspC.h
DSP‑C placeholder definitions
PECpp.h
Embedded C++ detection macros
License.txt
MIT License file
README.md
Usage examples and project notes
C Standard Detection (PC.h)
Detection Macros
Macro
Description
C_STD
1 if __STDC__ is defined, otherwise 0
C_VERSION
Numeric C standard version
C_STD_HOSTED
1 hosted, 0 freestanding, -1 unknown
Supported C Standards
Macro
Meaning
CKR
K&R C (pre-ANSI) or Non standard C
C89
ANSI C (C89/C90)
C95
ISO C95
C99
ISO C99
C11
ISO C11
C17
ISO C17
C23
ISO C23
NOC
Not a C environment (e.g., compiling as C++)
C++ Standard Detection (PCpp.h)
Detection Macros
Macro
Description
CPP_VERSION
Numeric C++ standard version
Supported C++ Standards
Macro
Meaning
CPPPRE
Pre-standard C++
CPP98
C++98
CPP03
C++03
CPP11
C++11
CPP14
C++14
CPP17
C++17
CPP20
C++20
CPP23
C++23
NOCPP
Not a C++ environment (e.g., compiling as C)
Alias Macros
Alias
Original Macro
CXXPRE
CPPPRE
CXX98
CPP98
CXX03
CPP03
CXX11
CPP11
CXX14
CPP14
CXX17
CPP17
CXX20
CPP20
CXX23
CPP23
NOCXX
NOCPP
C++/CLI Standard Detection (PCppCli.h)
Detection Macros
Macro
Description
CPPCLI_VERSION
Numeric C++ CLI standard version
Supported C++/CLI Standards
Macro
Meaning
CPPCLIPRE
Pre-standard C++/CLI
CPPCLI
C++/CLI
NOCPPCLI
Not a C++ CLI environment
Alias Macros
Alias
Original Macro
CXXCLIPRE
CPPCLIPRE
CXXCLI
CPPCLI
NOCXXCLI
NOCPPCLI
Embedded C++ Detection (PECpp.h)
Detection Macros
Macro
Description
ECPP_VERSION
Numeric EC++ version
Supported Values
Macro
Meaning
NOECPP
Embedded C++ not active
DSP‑C Detection (PDspC.h)
Currently only a placeholder.
Reserved for future expansion.
Usage
Detecting C Standard
To check which C standard is being used, you can use the predefined macros in conditional compilation blocks.
C Version Detection Example (Conditional Compilation)