default platform + impl all functions

This commit is contained in:
Hunter 2024-09-29 11:07:13 -04:00
parent 8ff3047aec
commit f32bf63c98
10 changed files with 72 additions and 45 deletions

View file

@ -5,6 +5,25 @@
#include <string>
#include <vector>
// https://stackoverflow.com/questions/1505582/determining-32-vs-64-bit-in-c
#if _WIN32 || _WIN64
#if _WIN64
#define ENVIRONMENT64
#else
#define ENVIRONMENT32
#endif
#endif
// Check GCC
#if __GNUC__
#if __x86_64__ || __ppc64__
#define ENVIRONMENT64
#else
#define ENVIRONMENT32
#endif
#endif
#define GRBC_VERSION "1.0"
enum LanguageType { LanguageType_CPP, LanguageType_C };
@ -171,7 +190,7 @@ struct Platform {
bool is_64bit = true;
/// Type of the platform
PlatformType platform_type;
PlatformType platform_type = PlatformType_Linux;
};
/// Functions
@ -180,7 +199,7 @@ void grbc_want_version(const std::string &version);
void grbc_exception(const std::string &exception_string);
GlobalConfig& grbc_get_config();
GlobalConfig &grbc_get_config();
std::string grbc_file(const std::string &file_path);
@ -227,4 +246,9 @@ Package grbc_pkg(const std::string &package_name);
void grbc_ext(const std::string &extension_id);
void grbc_register_ext(const Extension &ext);
void grbc_register_ext(const Extension &ext);
bool grbc_has_ext(const std::string &extension_id);
std::string grbc_platform_file(PlatformType platform_type,
const std::string &file_name);

View file

@ -8,7 +8,7 @@
#include <vector>
struct GState {
Platform current_platform;
Platform current_platform{};
sol::state lua;
std::vector<GeneratorTarget> targets;