Path: blob/master/dep/zydis/include/Zydis/Defines.h
4216 views
/***************************************************************************************************12Zyan Disassembler Library (Zydis)34Original Author : Joel Hoener56* Permission is hereby granted, free of charge, to any person obtaining a copy7* of this software and associated documentation files (the "Software"), to deal8* in the Software without restriction, including without limitation the rights9* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell10* copies of the Software, and to permit persons to whom the Software is11* furnished to do so, subject to the following conditions:12*13* The above copyright notice and this permission notice shall be included in all14* copies or substantial portions of the Software.15*16* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR17* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,18* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE19* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER20* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,21* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE22* SOFTWARE.2324***************************************************************************************************/2526/**27* @file28* Import/export defines for MSVC builds.29*/3031#ifndef ZYDIS_DEFINES_H32#define ZYDIS_DEFINES_H3334#include <Zycore/Defines.h>3536// This is a cut-down version of what CMake's `GenerateExportHeader` would usually generate. To37// simplify builds without CMake, we define these things manually instead of relying on CMake38// to generate the header.39//40// For static builds, our CMakeList will define `ZYDIS_STATIC_BUILD`. For shared library builds,41// our CMake will define `ZYDIS_SHOULD_EXPORT` depending on whether the target is being imported or42// exported. If CMake isn't used, users can manually define these to fit their use-case.4344// Backward compatibility: CMake would previously generate these variables names. However, because45// they have pretty cryptic names, we renamed them when we got rid of `GenerateExportHeader`. For46// backward compatibility for users that don't use CMake and previously manually defined these, we47// translate the old defines here and print a warning.48#if defined(ZYDIS_STATIC_DEFINE)49# pragma message("ZYDIS_STATIC_DEFINE was renamed to ZYDIS_STATIC_BUILD.")50# define ZYDIS_STATIC_BUILD51#endif52#if defined(Zydis_EXPORTS)53# pragma message("Zydis_EXPORTS was renamed to ZYDIS_SHOULD_EXPORT.")54# define ZYDIS_SHOULD_EXPORT55#endif5657/**58* Symbol is exported in shared library builds.59*/60#if defined(ZYDIS_STATIC_BUILD)61# define ZYDIS_EXPORT62#else63# if defined(ZYDIS_SHOULD_EXPORT)64# define ZYDIS_EXPORT ZYAN_DLLEXPORT65# else66# define ZYDIS_EXPORT ZYAN_DLLIMPORT67# endif68#endif6970/**71* Symbol is not exported and for internal use only.72*/73#define ZYDIS_NO_EXPORT7475#endif // ZYDIS_DEFINES_H767778