utils.h
1 /* EVMC: Ethereum Client-VM Connector API. 2 * Copyright 2018-2019 The EVMC Authors. 3 * Licensed under the Apache License, Version 2.0. 4 */ 5 6 #pragma once 7 8 /** 9 * @file 10 * A collection of helper macros to handle some non-portable features of C/C++ compilers. 11 * 12 * @addtogroup helpers 13 * @{ 14 */ 15 16 /** 17 * @def EVMC_EXPORT 18 * Marks a function to be exported from a shared library. 19 */ 20 #if defined _MSC_VER || defined __MINGW32__ 21 #define EVMC_EXPORT __declspec(dllexport) 22 #else 23 #define EVMC_EXPORT __attribute__((visibility("default"))) 24 #endif 25 26 /** 27 * @def EVMC_NOEXCEPT 28 * Safe way of marking a function with `noexcept` C++ specifier. 29 */ 30 #if __cplusplus 31 #define EVMC_NOEXCEPT noexcept 32 #else 33 #define EVMC_NOEXCEPT 34 #endif 35 36 /** @} */