35 lines
920 B
C++
35 lines
920 B
C++
#pragma once
|
|
#include <iostream>
|
|
#include <vector>
|
|
#include "zlog.h"
|
|
struct Detail {
|
|
int count = 0;
|
|
int new_count = 0;
|
|
int del_count = 0;
|
|
};
|
|
struct Module;
|
|
ZLIB_API inline Detail detail;
|
|
ZLIB_API inline std::vector<Module*>* 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<Module*>;
|
|
}
|
|
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 |