util: Move compiler configuration defines from detect_arch.h into detect_cc.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19674>
This commit is contained in:
Yonggang Luo 2022-11-10 14:14:10 +08:00 committed by Marge Bot
parent 845222dbae
commit db01b983ed
2 changed files with 31 additions and 29 deletions

View file

@ -47,36 +47,8 @@
#define UTIL_DETECT_ARCH_H_
#include <limits.h>
/*
* Compiler
*/
#if defined(__GNUC__)
#define PIPE_CC_GCC
#define PIPE_CC_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
#endif
/*
* Meaning of _MSC_VER value:
* - 1800: Visual Studio 2013
* - 1700: Visual Studio 2012
* - 1600: Visual Studio 2010
* - 1500: Visual Studio 2008
* - 1400: Visual C++ 2005
* - 1310: Visual C++ .NET 2003
* - 1300: Visual C++ .NET 2002
*
* __MSC__ seems to be an old macro -- it is not pre-defined on recent MSVC
* versions.
*/
#if defined(_MSC_VER) || defined(__MSC__)
#define PIPE_CC_MSVC
#endif
#if defined(__ICL)
#define PIPE_CC_ICL
#endif
#include "util/detect_cc.h"
/*
* Processor architecture

View file

@ -39,4 +39,34 @@
#ifndef UTIL_DETECT_CC_H_
#define UTIL_DETECT_CC_H_
/*
* Compiler
*/
#if defined(__GNUC__)
#define PIPE_CC_GCC
#define PIPE_CC_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
#endif
/*
* Meaning of _MSC_VER value:
* - 1800: Visual Studio 2013
* - 1700: Visual Studio 2012
* - 1600: Visual Studio 2010
* - 1500: Visual Studio 2008
* - 1400: Visual C++ 2005
* - 1310: Visual C++ .NET 2003
* - 1300: Visual C++ .NET 2002
*
* __MSC__ seems to be an old macro -- it is not pre-defined on recent MSVC
* versions.
*/
#if defined(_MSC_VER) || defined(__MSC__)
#define PIPE_CC_MSVC
#endif
#if defined(__ICL)
#define PIPE_CC_ICL
#endif
#endif /* UTIL_DETECT_CC_H_ */