OILS / vendor / souffle / utility / General.h View on Github | oilshell.org

27 lines, 5 significant
1/*
2 * Souffle - A Datalog Compiler
3 * Copyright (c) 2021, The Souffle Developers. All rights reserved
4 * Licensed under the Universal Permissive License v 1.0 as shown at:
5 * - https://opensource.org/licenses/UPL
6 * - <souffle root>/licenses/SOUFFLE-UPL.txt
7 */
8
9/************************************************************************
10 *
11 * @file General.h
12 *
13 * @brief Lightweight / cheap header for misc utilities.
14 *
15 * Misc utilities that require non-trivial headers should go in `MiscUtil.h`
16 *
17 ***********************************************************************/
18
19#if defined(_MSC_VER)
20#define SOUFFLE_ALWAYS_INLINE /* TODO: MSVC equiv */
21#else
22// clang / gcc recognize this attribute
23// NB: GCC will only inline when optimisation is on, and will warn about it.
24// Adding `inline` (even though the KW nominally has nothing to do with
25// inlining) will force it to inline in all cases. Lovely.
26#define SOUFFLE_ALWAYS_INLINE [[gnu::always_inline]] inline
27#endif