summaryrefslogtreecommitdiff
path: root/compiler/ann-ref/src/ops/internal/Macro.h
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/ann-ref/src/ops/internal/Macro.h')
-rw-r--r--compiler/ann-ref/src/ops/internal/Macro.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/compiler/ann-ref/src/ops/internal/Macro.h b/compiler/ann-ref/src/ops/internal/Macro.h
new file mode 100644
index 000000000..b80a748bb
--- /dev/null
+++ b/compiler/ann-ref/src/ops/internal/Macro.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __COMPATIBILITY_H__
+#define __COMPATIBILITY_H__
+
+#include <cassert>
+#include <cstdint>
+
+#ifndef DCHECK
+#define DCHECK(condition) assert((condition))
+#endif
+
+#ifndef DCHECK_EQ
+#define DCHECK_EQ(x, y) assert((x) == (y))
+#endif
+
+#ifndef DCHECK_GE
+#define DCHECK_GE(x, y) assert((x) >= (y))
+#endif
+
+#ifndef DCHECK_GT
+#define DCHECK_GT(x, y) assert((x) > (y))
+#endif
+
+#ifndef DCHECK_LE
+#define DCHECK_LE(x, y) assert((x) <= (y))
+#endif
+
+#ifndef DCHECK_LT
+#define DCHECK_LT(x, y) assert((x) < (y))
+#endif
+
+#ifndef CHECK_EQ
+#define CHECK_EQ(x, y) assert((x) == (y))
+#endif
+
+using uint8 = std::uint8_t;
+using int16 = std::int16_t;
+using uint16 = std::uint16_t;
+using int32 = std::int32_t;
+using uint32 = std::uint32_t;
+
+#endif // __COMPATIBILITY_H__