#pragma once #include #include #include "zlog.h" struct Detail { int count = 0; int new_count = 0; int del_count = 0; Detail() { std::cout << "Detail" << std::endl; } }; struct Module; ZLIB_API inline Detail detail; ZLIB_API inline std::vector* pModuleList; struct Module { std::string name; bool kind; void* mHandle{nullptr}; bool Load(std::string path = ""); void* GetSymbol(const char* name); Module(std::string name, bool kind):kind(kind), name(name){ detail.count++; if (!pModuleList) { pModuleList = new std::vector; } auto ptr = this; pModuleList->push_back(this); std::string kind_str = kind ? std::string("shared") : std::string("static"); std::cout << detail.count << ":" << uintptr_t(&zlog::zlog) << "::" << name << ":" << kind_str << std::endl; } }; const char* zlib(); #ifdef ZLIB_API_VAL ZLIB_API inline Module zlib_module{ zlib(), false }; #else ZLIB_API extern Module zlib_module; #endif