diff options
| -rw-r--r-- | Makefile | 6 | ||||
| -rw-r--r-- | common.mk | 1 | ||||
| -rw-r--r-- | file.h | 10 | ||||
| -rw-r--r-- | mime.h | 4 | ||||
| -rw-r--r-- | stringutil.h | 9 | ||||
| -rw-r--r-- | tempfile.h | 4 | ||||
| -rw-r--r-- | url.h | 4 | 
7 files changed, 26 insertions, 12 deletions
| @@ -11,7 +11,11 @@ SONAME1=libreichwein.so  SONAME2=libreichwein.so.0  SONAME3=libreichwein.so.0.0.0 -CXXFLAGS+= -fvisibility=hidden -fPIC +# By default, don't export. Explicitly mark exports in C++ with: +# __attribute__((visibility("default"))) +CXXFLAGS+=-fvisibility=hidden + +CXXFLAGS+=-fPIC  PROGSRC=\      file.cpp \ @@ -49,6 +49,7 @@ endif  CXXFLAGS+=-Wall -I.  CXXFLAGS+=-Wpedantic -gdwarf-4 +CXXFLAGS+=-fexceptions -Iexternal  ifeq ($(CXX),clang++-11)  CXXFLAGS+=-std=c++20 #-stdlib=libc++ @@ -5,11 +5,13 @@  #include <string>  #include <vector> +#define EXPORT __attribute__((visibility("default"))) +  namespace File { -std::string getFile(const std::filesystem::path& filename); -void setFile(const std::filesystem::path& filename, const std::string& s); -void setFile(const std::filesystem::path& filename, const char* data, size_t size); -void setFile(const std::filesystem::path& filename, const std::vector<uint8_t>& data); +EXPORT std::string getFile(const std::filesystem::path& filename); +EXPORT void setFile(const std::filesystem::path& filename, const std::string& s); +EXPORT void setFile(const std::filesystem::path& filename, const char* data, size_t size); +EXPORT void setFile(const std::filesystem::path& filename, const std::vector<uint8_t>& data);  } @@ -2,4 +2,6 @@  #include <string> -std::string mime_type(const std::string& path); +#define EXPORT __attribute__((visibility("default"))) + +EXPORT std::string mime_type(const std::string& path); diff --git a/stringutil.h b/stringutil.h index 5110e2e..6cd74aa 100644 --- a/stringutil.h +++ b/stringutil.h @@ -3,8 +3,9 @@  #include <string>  #include <vector> -std::string strfmt(const char* fmt, ...); +#define EXPORT __attribute__((visibility("default"))) -std::vector<std::string> split(std::string value, const std::string separators = "\r\n "); -std::string join(std::vector<std::string> vs, std::string separator = "\n"); -bool startsWithAnyOfLower(const std::string &s, const std::vector<std::string> &list); +EXPORT std::string strfmt(const char* fmt, ...); +EXPORT std::vector<std::string> split(std::string value, const std::string separators = "\r\n "); +EXPORT std::string join(std::vector<std::string> vs, std::string separator = "\n"); +EXPORT bool startsWithAnyOfLower(const std::string &s, const std::vector<std::string> &list); @@ -2,7 +2,9 @@  #include <filesystem> -class Tempfile +#define EXPORT __attribute__((visibility("default"))) + +EXPORT class Tempfile  {   std::filesystem::path m_path; @@ -2,5 +2,7 @@  #include <string> -std::string urlDecode(std::string s); +#define EXPORT __attribute__((visibility("default"))) + +EXPORT std::string urlDecode(std::string s); | 
