Parcourir la source

refactor & fix: 修复 class Export 标志错误的问题

SongZihuan il y a 3 ans
Parent
commit
0d02b019e0

+ 4 - 4
include/core/activation.h

@@ -6,7 +6,7 @@
 #include "value.h"
 
 namespace aFuncore {
-    AFUN_CORE_EXPORT class Activation {
+    class AFUN_CORE_EXPORT Activation {
     protected:
         Activation *prev;
 
@@ -37,7 +37,7 @@ namespace aFuncore {
         [[nodiscard]] const StringFilePath &getFilePath() const {return path;}
     };
 
-    AFUN_CORE_EXPORT class ExeActivation : public Activation {
+    class AFUN_CORE_EXPORT ExeActivation : public Activation {
         Code *start;
         Code *next;
         bool first=true;
@@ -47,13 +47,13 @@ namespace aFuncore {
         [[nodiscard]] Code *getStart() const {return start;}
     };
 
-    AFUN_CORE_EXPORT class TopActivation : public ExeActivation {
+    class AFUN_CORE_EXPORT TopActivation : public ExeActivation {
     public:
         explicit TopActivation(Code *code, Inter *inter_);
         ~TopActivation() override;
     };
 
-    AFUN_CORE_EXPORT class FuncActivation : public Activation {
+    class AFUN_CORE_EXPORT FuncActivation : public Activation {
         enum {
             func_first = 0,
             func_get_func = 1,

+ 1 - 1
include/core/code.h

@@ -5,7 +5,7 @@
 #include "core.h"
 
 namespace aFuncore {
-    AFUN_CORE_EXPORT class Code {
+    class AFUN_CORE_EXPORT Code {
         CodeType type;
         char prefix=NUL;
 

+ 22 - 22
include/core/core.h

@@ -15,11 +15,11 @@ namespace aFuncore {
         block_b = '[',
         block_c = '{',
     } BlockType;
-    AFUN_CORE_EXPORT class Code;
+    class AFUN_CORE_EXPORT Code;
 
-    AFUN_CORE_EXPORT class EnvVarSpace;
+    class AFUN_CORE_EXPORT EnvVarSpace;
 
-    AFUN_CORE_EXPORT class Inter;
+    class AFUN_CORE_EXPORT Inter;
     enum InterStatus {
         inter_creat = 0,
         inter_init = 1,  // 执行初始化程序
@@ -46,35 +46,35 @@ namespace aFuncore {
     static const std::string E_PREFIX = "$`'";  /* NOLINT element前缀 */
     static const std::string B_PREFIX = "$`'%^&<?>";  /* NOLINT block前缀 */
 
-    AFUN_CORE_EXPORT class Message;
-    AFUN_CORE_EXPORT class NormalMessage;
-    AFUN_CORE_EXPORT class ErrorMessage;
+    class AFUN_CORE_EXPORT Message;
+    class AFUN_CORE_EXPORT NormalMessage;
+    class AFUN_CORE_EXPORT ErrorMessage;
 
-    AFUN_CORE_EXPORT class MessageStream;
-    AFUN_CORE_EXPORT class UpMessage;
-    AFUN_CORE_EXPORT class DownMessage;
+    class AFUN_CORE_EXPORT MessageStream;
+    class AFUN_CORE_EXPORT UpMessage;
+    class AFUN_CORE_EXPORT DownMessage;
 
-    AFUN_CORE_EXPORT class Activation;
-    AFUN_CORE_EXPORT class ExeActivation;
-    AFUN_CORE_EXPORT class TopActivation;
-    AFUN_CORE_EXPORT class FuncActivation;
+    class AFUN_CORE_EXPORT Activation;
+    class AFUN_CORE_EXPORT ExeActivation;
+    class AFUN_CORE_EXPORT TopActivation;
+    class AFUN_CORE_EXPORT FuncActivation;
     typedef enum ActivationStatus {
         as_run = 0,
         as_end = 1,
         as_end_run = 2,
     } ActivationStatus;
 
-    AFUN_CORE_EXPORT class GcList;
+    class AFUN_CORE_EXPORT GcList;
 
-    AFUN_CORE_EXPORT class Object;
-    AFUN_CORE_EXPORT class Function;
-    AFUN_CORE_EXPORT class Literaler;
-    AFUN_CORE_EXPORT class CallBackVar;
+    class AFUN_CORE_EXPORT Object;
+    class AFUN_CORE_EXPORT Function;
+    class AFUN_CORE_EXPORT Literaler;
+    class AFUN_CORE_EXPORT CallBackVar;
 
-    AFUN_CORE_EXPORT class Var;
-    AFUN_CORE_EXPORT class VarSpace;
-    AFUN_CORE_EXPORT class VarList;
-    AFUN_CORE_EXPORT class ProtectVarSpace;
+    class AFUN_CORE_EXPORT Var;
+    class AFUN_CORE_EXPORT VarSpace;
+    class AFUN_CORE_EXPORT VarList;
+    class AFUN_CORE_EXPORT ProtectVarSpace;
     typedef enum VarOperationFlat {
         vof_success = 0,  // 成功
         vof_not_var = 1,  // 变量不存在

+ 1 - 1
include/core/env-var.h

@@ -4,7 +4,7 @@
 #include "aFunCoreExport.h"
 
 namespace aFuncore {
-    AFUN_CORE_EXPORT class EnvVarSpace {  // 环境变量
+    class AFUN_CORE_EXPORT EnvVarSpace {  // 环境变量
         static const size_t ENV_VAR_HASH_SIZE = 100;  // 环境变量哈希表大小
         struct EnvVar {  // 环境变量
             std::string name;

+ 2 - 2
include/core/gc.h

@@ -7,7 +7,7 @@
 namespace aFuncore {
     typedef unsigned GcCount;
 
-    AFUN_CORE_EXPORT class GcObjectBase {
+    class AFUN_CORE_EXPORT GcObjectBase {
         bool not_clear;  // 不清除
         bool reachable;  // 可达标记 [同时标识已迭代]
         GcCount reference;  // 引用计数
@@ -54,7 +54,7 @@ namespace aFuncore {
         }
     };
 
-    AFUN_CORE_EXPORT class GcList {
+    class AFUN_CORE_EXPORT GcList {
         std::queue<GcObjectBase *> queue;
     public :
         size_t add(GcObjectBase *obj);

+ 1 - 1
include/core/inter.h

@@ -6,7 +6,7 @@
 #include "core.h"
 
 namespace aFuncore {
-    AFUN_CORE_EXPORT class Inter {
+    class AFUN_CORE_EXPORT Inter {
         friend class Object;
         friend class Var;
         friend class VarSpace;

+ 6 - 6
include/core/msg.h

@@ -6,7 +6,7 @@
 #include "list"
 
 namespace aFuncore {
-    AFUN_CORE_EXPORT class Message {
+    class AFUN_CORE_EXPORT Message {
         friend class MessageStream;
         friend class UpMessage;
         friend class DownMessage;
@@ -25,7 +25,7 @@ namespace aFuncore {
         virtual void topProgress() = 0;
     };
 
-    AFUN_CORE_EXPORT class NormalMessage : public TopMessage {
+    class AFUN_CORE_EXPORT NormalMessage : public TopMessage {
         Object *obj;
     public:
         explicit NormalMessage(Object *obj_) : TopMessage("NORMAL"), obj {obj_} {}
@@ -34,7 +34,7 @@ namespace aFuncore {
         Object *getObject() {return obj;}
     };
 
-    AFUN_CORE_EXPORT class ErrorMessage : public TopMessage {
+    class AFUN_CORE_EXPORT ErrorMessage : public TopMessage {
         Inter *inter;
 
         std::string error_type;
@@ -51,7 +51,7 @@ namespace aFuncore {
         std::string getErrorInfo() {return error_info;}
     };
 
-    AFUN_CORE_EXPORT class MessageStream {
+    class AFUN_CORE_EXPORT MessageStream {
     protected:
         Message *stream;
         [[nodiscard]] virtual Message *_getMessage(const std::string &type) const;
@@ -78,7 +78,7 @@ namespace aFuncore {
         }
     };
 
-    AFUN_CORE_EXPORT class UpMessage : public MessageStream {
+    class AFUN_CORE_EXPORT UpMessage : public MessageStream {
     protected:
         Message *old;
     public:
@@ -88,7 +88,7 @@ namespace aFuncore {
         Message *popMessage(const std::string &type) override;
     };
 
-    AFUN_CORE_EXPORT class DownMessage : public MessageStream {
+    class AFUN_CORE_EXPORT DownMessage : public MessageStream {
     public:
         void joinMsg(DownMessage *msg);
     };

+ 5 - 5
include/core/value.h

@@ -7,7 +7,7 @@
 #include "gc.h"
 
 namespace aFuncore {
-    AFUN_CORE_EXPORT class Object : public GcObject<class Object> {
+    class AFUN_CORE_EXPORT Object : public GcObject<class Object> {
     public:
         Inter *const inter;
         const std::string type;  // 标识 Object 的字符串
@@ -16,11 +16,11 @@ namespace aFuncore {
         ~Object() override =default;
     };
 
-    AFUN_CORE_EXPORT class Function : public Object {
+    class AFUN_CORE_EXPORT Function : public Object {
     public:
         Function(const std::string &type_, Inter *inter_) : Object(type_ + ":Function", inter_) {}
 
-        AFUN_CORE_EXPORT class CallFunction {
+        class AFUN_CORE_EXPORT CallFunction {
         public:
             struct ArgCodeList {
                 Code *code = nullptr;
@@ -38,14 +38,14 @@ namespace aFuncore {
         virtual bool isInfix() {return false;}
     };
 
-    AFUN_CORE_EXPORT class Literaler : public Object {
+    class AFUN_CORE_EXPORT Literaler : public Object {
     public:
         Literaler(const std::string &type_, Inter *inter_) : Object(type_ + ":Literaler", inter_) {}
 
         virtual void getObject(const std::string &literal, char prefix) = 0;
     };
 
-    AFUN_CORE_EXPORT class CallBackVar : public Object {
+    class AFUN_CORE_EXPORT CallBackVar : public Object {
     public:
         CallBackVar(const std::string &type_, Inter *inter_) : Object(type_ + ":CallBackVar", inter_) {}
 

+ 4 - 4
include/core/var.h

@@ -7,7 +7,7 @@
 #include <list>
 
 namespace aFuncore {
-    AFUN_CORE_EXPORT class Var : public GcObject<class Var> {
+    class AFUN_CORE_EXPORT Var : public GcObject<class Var> {
         Object *data;
     public:
         Inter *const inter;
@@ -19,7 +19,7 @@ namespace aFuncore {
         virtual void setData(Object *data_) {data = data_;}
     };
 
-    AFUN_CORE_EXPORT class VarSpace : public GcObject<class VarSpace> {
+    class AFUN_CORE_EXPORT VarSpace : public GcObject<class VarSpace> {
     public:
         static const size_t VAR_HASH_SIZE = 100;  // 环境变量哈希表大小
     private:
@@ -48,7 +48,7 @@ namespace aFuncore {
         }
     };
 
-    AFUN_CORE_EXPORT class ProtectVarSpace : public VarSpace {
+    class AFUN_CORE_EXPORT ProtectVarSpace : public VarSpace {
         bool is_protect;
     public:
         explicit ProtectVarSpace(Inter *inter_) : VarSpace(inter_), is_protect{false} {}
@@ -62,7 +62,7 @@ namespace aFuncore {
         VarOperationFlat delVar(const std::string &name) override;
     };
 
-    AFUN_CORE_EXPORT class VarList {
+    class AFUN_CORE_EXPORT VarList {
         std::list<VarSpace *> varspace;
     public:
         explicit VarList() = default;

+ 1 - 1
include/tool/dlc.h

@@ -35,7 +35,7 @@ namespace aFuntool {
      * 注意: 仅能通过 openLibrary生成
      * 不需要 delete 释放 (自动管理释放)
      */
-    AFUN_TOOL_EXPORT class DlcHandle {
+    class AFUN_TOOL_EXPORT DlcHandle {
         friend AFUN_TOOL_EXPORT void dlcExit();
         friend AFUN_TOOL_EXPORT DlcHandle *openLibrary(const char *file, int mode);
 

+ 3 - 3
include/tool/log.h

@@ -17,9 +17,9 @@ namespace aFuntool {
     };
     typedef enum LogLevel LogLevel;
 
-    AFUN_TOOL_EXPORT class LogFactory;
+    class AFUN_TOOL_EXPORT LogFactory;
 
-    AFUN_TOOL_EXPORT class Logger {
+    class AFUN_TOOL_EXPORT Logger {
         const std::string id;
         LogLevel level = log_debug;
         bool exit = true;
@@ -36,7 +36,7 @@ namespace aFuntool {
     };
 
 
-    AFUN_TOOL_EXPORT class LogFactory {
+    class AFUN_TOOL_EXPORT LogFactory {
         bool init;  // 是否已经初始化
         pid_t pid;
 

+ 1 - 1
include/tool/regex.h

@@ -9,7 +9,7 @@
 namespace aFuntool {
     const int REGEX_ERROR_SIZE = 512;
 
-    AFUN_TOOL_EXPORT class Regex {
+    class AFUN_TOOL_EXPORT Regex {
         pcre2_code *re;  // 正则表达式
         const std::string pattern;  // 正则表达式的字符串
     public: