|
@@ -1,25 +1,30 @@
|
|
|
//-------------------------------------------------------------------------------------------------------
|
|
//-------------------------------------------------------------------------------------------------------
|
|
|
-// Copyright (C) Microsoft. All rights reserved.
|
|
|
|
|
|
|
+// ChakraCore/Pal
|
|
|
|
|
+// Contains portions (c) copyright Microsoft, portions copyright (c) the .NET Foundation and Contributors
|
|
|
|
|
+// and edits (c) copyright the ChakraCore Contributors.
|
|
|
|
|
+// See THIRD-PARTY-NOTICES.txt in the project root for .NET Foundation license
|
|
|
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
|
|
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
|
|
|
//-------------------------------------------------------------------------------------------------------
|
|
//-------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// PAL free Assert definitions
|
|
// PAL free Assert definitions
|
|
|
#ifdef DEBUG
|
|
#ifdef DEBUG
|
|
|
|
|
|
|
|
-#define _QUOTE_(s) #s
|
|
|
|
|
-#define _STRINGIZE_(s) _QUOTE_(s)
|
|
|
|
|
|
|
+#if !defined(CHAKRACORE_STRINGIZE)
|
|
|
|
|
+#define CHAKRACORE_STRINGIZE_IMPL(x) #x
|
|
|
|
|
+#define CHAKRACORE_STRINGIZE(x) CHAKRACORE_STRINGIZE_IMPL(x)
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
#ifndef __ANDROID__
|
|
#ifndef __ANDROID__
|
|
|
#define _ERR_OUTPUT_(condition, comment) \
|
|
#define _ERR_OUTPUT_(condition, comment) \
|
|
|
fprintf(stderr, "ASSERTION (%s, line %d) %s %s\n", __FILE__, __LINE__, \
|
|
fprintf(stderr, "ASSERTION (%s, line %d) %s %s\n", __FILE__, __LINE__, \
|
|
|
- _STRINGIZE_(condition), comment); \
|
|
|
|
|
|
|
+ CHAKRACORE_STRINGIZE(condition), comment); \
|
|
|
fflush(stderr);
|
|
fflush(stderr);
|
|
|
#else // ANDROID
|
|
#else // ANDROID
|
|
|
#include <android/log.h>
|
|
#include <android/log.h>
|
|
|
#define _ERR_OUTPUT_(condition, comment) \
|
|
#define _ERR_OUTPUT_(condition, comment) \
|
|
|
__android_log_print(ANDROID_LOG_ERROR, "chakracore-log", \
|
|
__android_log_print(ANDROID_LOG_ERROR, "chakracore-log", \
|
|
|
"ASSERTION (%s, line %d) %s %s\n", __FILE__, __LINE__, \
|
|
"ASSERTION (%s, line %d) %s %s\n", __FILE__, __LINE__, \
|
|
|
- _STRINGIZE_(condition), comment);
|
|
|
|
|
|
|
+ CHAKRACORE_STRINGIZE(condition), comment);
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
#define _Assert_(condition, comment) \
|
|
#define _Assert_(condition, comment) \
|