Skip to content

Instantly share code, notes, and snippets.

@vladiant
Created June 5, 2021 20:10
Show Gist options
  • Save vladiant/ecc4bdd277424054f6543c3a74eabd72 to your computer and use it in GitHub Desktop.
Save vladiant/ecc4bdd277424054f6543c3a74eabd72 to your computer and use it in GitHub Desktop.
Export methods
#pragma once
#ifdef _EXPORT
#ifdef _MSC_VER
#define DLL_API __declspec(dllexport)
#elif defined __GNUC__
#define DLL_API __attribute__((visibility("default")))
#endif
#else
#ifdef _MSC_VER
#define DLL_API __declspec(dllimport)
#elif defined __GNUC__
#define DLL_API __attribute__((visibility("hidden")))
#endif
#endif
#include "exporting.h"
extern "C" {
DLL_API void say_hello_dll();
}
// See https://github.com/onqtam/doctest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment