2019-07-18 04:04:00 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2019 Atmosphère-NX
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms and conditions of the GNU General Public License,
|
|
|
|
* version 2, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2019-10-25 08:12:47 +01:00
|
|
|
#include "common_includes.hpp"
|
2019-07-18 04:04:00 +01:00
|
|
|
|
|
|
|
/* Any broadly useful language defines should go here. */
|
|
|
|
|
2019-10-24 10:30:10 +01:00
|
|
|
#define AMS_ASSERT(expr) do { if (!(expr)) { std::abort(); } } while (0)
|
2019-09-28 02:04:58 +01:00
|
|
|
|
2019-10-24 10:30:10 +01:00
|
|
|
#define AMS_UNREACHABLE_DEFAULT_CASE() default: std::abort()
|
2019-09-28 23:13:20 +01:00
|
|
|
|
2019-07-18 04:04:00 +01:00
|
|
|
#define NON_COPYABLE(cls) \
|
|
|
|
cls(const cls&) = delete; \
|
|
|
|
cls& operator=(const cls&) = delete
|
|
|
|
|
|
|
|
#define NON_MOVEABLE(cls) \
|
|
|
|
cls(cls&&) = delete; \
|
|
|
|
cls& operator=(cls&&) = delete
|
|
|
|
|
|
|
|
#define ALIGNED(algn) __attribute__((aligned(algn)))
|
2019-10-24 09:40:44 +01:00
|
|
|
#define NORETURN __attribute__((noreturn))
|
2019-07-18 04:04:00 +01:00
|
|
|
#define WEAK __attribute__((weak))
|
|
|
|
|
|
|
|
|
2019-09-28 02:04:58 +01:00
|
|
|
#define CONCATENATE_IMPL(S1, s2) s1##s2
|
|
|
|
#define CONCATENATE(s1, s2) CONCATENATE_IMPL(s1, s2)
|
2019-07-18 04:04:00 +01:00
|
|
|
|
2019-09-28 02:04:58 +01:00
|
|
|
#ifdef __COUNTER__
|
|
|
|
#define ANONYMOUS_VARIABLE(pref) CONCATENATE(pref, __COUNTER__)
|
|
|
|
#else
|
|
|
|
#define ANONYMOUS_VARIABLE(pref) CONCATENATE(pref, __LINE__)
|
2019-10-25 08:12:47 +01:00
|
|
|
#endif
|