Skip to content

Commit b8a7d7b

Browse files
committed
Texmod: move gMod release structs to a named namespace
Glaze reflection can't bind types declared in an anonymous namespace (internal linkage), which broke the build. Mirror Updater's github_api structs by giving them external linkage in a named namespace.
1 parent 2571964 commit b8a7d7b

1 file changed

Lines changed: 15 additions & 9 deletions

File tree

GWToolboxdll/Modules/TexmodModule.cpp

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,20 @@
2626
#include <Modules/Resources.h>
2727
#include <Utils/FontLoader.h>
2828

29+
// gMod GitHub release shape, parsed from the releases API. Kept at namespace scope
30+
// (external linkage) because glaze reflection can't bind types from an anonymous
31+
// namespace - mirrors Updater's github_api structs.
32+
namespace gmod_github {
33+
struct ReleaseAsset {
34+
std::string name;
35+
std::string browser_download_url;
36+
};
37+
struct Release {
38+
std::string tag_name;
39+
std::vector<ReleaseAsset> assets;
40+
};
41+
}
42+
2943
namespace {
3044

3145
// =========================================================================
@@ -52,14 +66,6 @@ namespace {
5266
// managed automatically: on startup we fetch the latest release and, if it is
5367
// newer than the copy kept in the GWToolbox folder (or none is present), download
5468
// it there and load it.
55-
struct GModReleaseAsset {
56-
std::string name;
57-
std::string browser_download_url;
58-
};
59-
struct GModRelease {
60-
std::string tag_name;
61-
std::vector<GModReleaseAsset> assets;
62-
};
6369
constexpr glz::opts gmod_json_opts{.error_on_unknown_keys = false};
6470

6571
enum class GmodUpdateStep { Idle, Checking, Downloading };
@@ -635,7 +641,7 @@ namespace {
635641
tries++;
636642
} while (!success && tries < 5);
637643

638-
GModRelease release;
644+
gmod_github::Release release;
639645
const bool parsed = success && !glz::read<gmod_json_opts>(release, response);
640646

641647
std::string version, dll_url;

0 commit comments

Comments
 (0)