提交 3d3ed70b 编写于 作者: S Stephen Toub

Add safemath.h and debugmacrosext.h from coreclr repo

We'd like to be able to use builtins for overflow checking, but the relevant builtins (e.g. __builtin_mul_overflow) aren't available with the compiler versions we currently use on all platforms.  In the meantime, we'll use the ClrSafeInt implementation from coreclr.

This commit brings over the files, but they don't yet compile.


Commit migrated from https://github.com/dotnet/corefx/commit/df73b81a5386249d001d9db9a4605f4f97e5e3c5
上级 f05a8c41
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
//*****************************************************************************
// DebugMacrosExt.h
//
// Simple debugging macros that take no dependencies on CLR headers.
// This header can be used from outside the CLR.
//
//*****************************************************************************
#ifndef __DebugMacrosExt_h__
#define __DebugMacrosExt_h__
#if !defined(_DEBUG_IMPL) && defined(_DEBUG) && !defined(DACCESS_COMPILE)
#define _DEBUG_IMPL 1
#endif
#ifdef _DEBUG
// A macro to execute a statement only in _DEBUG.
#define DEBUG_STMT(stmt) stmt
#define INDEBUG(x) x
#define INDEBUG_COMMA(x) x,
#define COMMA_INDEBUG(x) ,x
#define NOT_DEBUG(x)
#else
#define DEBUG_STMT(stmt)
#define INDEBUG(x)
#define INDEBUG_COMMA(x)
#define COMMA_INDEBUG(x)
#define NOT_DEBUG(x) x
#endif
#ifdef _DEBUG_IMPL
#define INDEBUGIMPL(x) x
#define INDEBUGIMPL_COMMA(x) x,
#define COMMA_INDEBUGIMPL(x) ,x
#else
#define INDEBUGIMPL(x)
#define INDEBUGIMPL_COMMA(x)
#define COMMA_INDEBUGIMPL(x)
#endif
#endif
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册