In climit
// climits standard header (core)
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#pragma once
#ifndef _CLIMITS_
#define _CLIMITS_
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <limits.h>
#endif // _STL_COMPILER_PREPROCESSOR
#endif // _CLIMITS_
Why there is #ifndef _CLIMITS_
if already use #pragma once
?
#pragma once
runs into issues if it's difficult for the preprocessor to tell whether two files are "the same" file or not. Hence doing it both ways._CLIMITS_
as the name of the include guard is okay. That name (beginning with an underscore followed by a capital letter) is reserved for use by the implementation. Don't take this as an example of how you should write your own include guards.#pragma once
. Or, for anti-trust reasons, they have to make it work on other compilers that never had it.