{"repo":"cpredef/predef","free":true,"listed":false,"github":"https://github.com/cpredef/predef","clone":"git clone https://github.com/cpredef/predef.git","description":"Pre-defined Compiler Macros wiki","language":null,"stars":668,"topics":["c","documentation","ifdef","portability"],"license":"CC-BY-4.0","category":"docs-static-sites","readme_excerpt":"Pre-defined C/C++ Compiler Macros # The macros are found here: Standards Compilers Libraries Operating systems Architectures General guidelines are found here: Version normalization Feature macros Endianness Please send updates/corrections to predef-contribute or through pull requests on GitHub. Introduction ## C and C++ compilers automatically define certain macros that can be used to check for compiler or operating system features. This is useful when writing portable software. These pages lists various pre-defined compiler macros that can be used to identify standards, compilers, operating systems, hardware architectures, and even basic run-time libraries at compile-time. For example, if we want to use a generic or opaque pointer type, we use void pointers. However, ancient K&R compilers (from the time before the first ANSI C standard) do not support void pointers. Instead we can define our own type: Another example, Microsoft Visual C++ version 4.2 added a pragma to reduce compilation times by only including a file once (if MSC VER is not defined then it will evaluate to 0 (zero) — however, some compilers may complain about an undefined macro) The macros contained in these pages have been obtained through vendor documentation, the defines script, contributors, and third-party source code. No guarantee about the correctness of the macros is given. An often-used alternative is Autoconf, which is a more powerful tool to examine various types of features, including compilatio","default_branch":null,"files":null,"tree":[],"storefront":"/r/cpredef","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/cpredef/predef/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}