From 0ea30b894a003cecfa99cb960e0fb8bdb24da34b Mon Sep 17 00:00:00 2001 From: Michael Uleysky Date: Mon, 14 Sep 2015 16:32:56 +1000 Subject: [PATCH] Move exported definitions in common.h --- src/common.h | 13 +++++++++++++ src/debug.h | 4 ---- src/globals.h | 13 ++++--------- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/common.h b/src/common.h index 6e7b27e..3391b0f 100644 --- a/src/common.h +++ b/src/common.h @@ -1,6 +1,19 @@ #ifndef COMMON_H #define COMMON_H +#include +#include #define EXPORT __attribute__ ((visibility ("default"))) +enum debug_level {INTERNALREQUEST,MOREDEBUG,DEBUG,INFO,NORMAL,WARNING,ERROR}; +EXPORT std::ostream& COUT(debug_level dl); + +class ObjectBase; +class ObjectList; +typedef ObjectBase* (*Func)(ObjectList*); + +extern "C" { +EXPORT void RegisterFunction(const std::string& name, Func func); +} + #endif \ No newline at end of file diff --git a/src/debug.h b/src/debug.h index 854d5df..6e2426e 100644 --- a/src/debug.h +++ b/src/debug.h @@ -3,10 +3,6 @@ #include #include "common.h" -enum debug_level {INTERNALREQUEST,MOREDEBUG,DEBUG,INFO,NORMAL,WARNING,ERROR}; - -EXPORT std::ostream& COUT(debug_level dl); - debug_level SetDebugLevel(debug_level dl=INTERNALREQUEST); #endif diff --git a/src/globals.h b/src/globals.h index c0bfae9..eafc759 100644 --- a/src/globals.h +++ b/src/globals.h @@ -7,27 +7,22 @@ // Variables definitions typedef std::map G_varsType; -extern EXPORT G_varsType G_vars; +extern G_varsType G_vars; // Functions addresses -typedef ObjectBase* (*Func)(ObjectList*); typedef std::multimap G_funcsType; -extern EXPORT G_funcsType G_funcs; +extern G_funcsType G_funcs; typedef std::vector G_toType; // List of objects to save -extern EXPORT G_toType G_tosave; +extern G_toType G_tosave; // List of objects to print -extern EXPORT G_toType G_toprint; +extern G_toType G_toprint; void ClearGlobals(); bool Save(ObjectList* input); bool Print(ObjectList* input); -extern "C" { -EXPORT void RegisterFunction(const std::string& name, Func func); -} - #endif