so that's how libraries work

This commit is contained in:
Nicholas O'Connor
2017-03-23 12:06:29 -07:00
parent 64c96cba26
commit 30d0787a62
5 changed files with 45 additions and 5 deletions

View File

@@ -5,6 +5,7 @@
#include <map>
#include <string>
#include "commands.hpp"
#include "json.hpp"
using namespace std;
@@ -27,8 +28,11 @@ namespace cellar {
string canonical_path;
Bottle();
};
map<string, Bottle> get_bottles();
extern map<string, Bottle> get_bottles();
}
namespace commands {
extern map<string, cellar::commands::CommandFunction> bottles_commands();
}
}
#endif // __BOTTLES_HPP

24
include/dll.hpp Normal file
View File

@@ -0,0 +1,24 @@
#if defined _WIN32 || defined __CYGWIN__
#ifdef BUILDING_DLL
#ifdef __GNUC__
#define DLL_PUBLIC __attribute__ ((dllexport))
#else
#define DLL_PUBLIC __declspec(dllexport) // Note: actually gcc seems to also supports this syntax.
#endif
#else
#ifdef __GNUC__
#define DLL_PUBLIC __attribute__ ((dllimport))
#else
#define DLL_PUBLIC __declspec(dllimport) // Note: actually gcc seems to also supports this syntax.
#endif
#endif
#define DLL_LOCAL
#else
#if __GNUC__ >= 4
#define DLL_PUBLIC __attribute__ ((visibility ("default")))
#define DLL_LOCAL __attribute__ ((visibility ("hidden")))
#else
#define DLL_PUBLIC
#define DLL_LOCAL
#endif
#endif