Skip to content

Commit

Permalink
fix compile errors in clang (it aint work)
Browse files Browse the repository at this point in the history
  • Loading branch information
tadgem committed Feb 27, 2024
1 parent 2161169 commit f58e288
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion editor/src/OpenSans.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#pragma warning( disable : 4838)
#pragma warning( disable : 4309)

static const char OpenSans[] = {
static const uint8_t OpenSans[] = {
0x00, 0x01, 0x00, 0x00, 0x00, 0x17, 0x01, 0x00, 0x00, 0x04, 0x00, 0x70, 0x47, 0x44, 0x45, 0x46,
0x31, 0x97, 0x76, 0xb2, 0x00, 0x00, 0x6b, 0xec, 0x00, 0x00, 0x1e, 0x7b, 0x47, 0x50, 0x4f, 0x53,
0x57, 0xa1, 0xa9, 0x2d, 0x00, 0x00, 0xb1, 0xd4, 0x00, 0x00, 0x63, 0xf6, 0x47, 0x53, 0x55, 0x42,
Expand Down
12 changes: 9 additions & 3 deletions graphscript/include/TypeDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,15 @@ namespace typehash_internal

template <typename T>
struct GetTypeNameHelper {
static constexpr std::string GetTypeName(void) {
static std::string GetTypeName(void) {
#ifdef __clang__
std::string fstring(__PRETTY_FUNCTION__);
static const size_t size = sizeof(__PRETTY_FUNCTION__) - FRONT_SIZE - BACK_SIZE;
std::string typeString = std::string(__PRETTY_FUNCTION__ + FRONT_SIZE, size - 1u);
#else
static const size_t size = sizeof(__FUNCTION__) - FRONT_SIZE - BACK_SIZE;
std::string typeString = std::string(__FUNCTION__ + FRONT_SIZE, size - 1u);
#endif
return typeString;
}
};
Expand Down Expand Up @@ -101,12 +107,12 @@ namespace gs
};

template <typename T>
constexpr std::string GetTypeName(void) {
static std::string GetTypeName(void) {
return typehash_internal::GetTypeNameHelper<T>::GetTypeName();
}

template<typename T>
constexpr HashString GetTypeHash() {
static HashString GetTypeHash() {
return HashString(GetTypeName<T>());
}

Expand Down
2 changes: 1 addition & 1 deletion graphscript/src/GraphScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ void gs::Context::Parser::ParseNodeDataConnection(GraphBuilder* builder, String&
GS_ASSERT(lhsNode != rhsNode, "Cannot connect a node to itself");
DataConnection* conn = p_Context.GetDataConnectionFromHash(lhsTypeHash)->Clone();

GS_ASSERT(conn != nullptr, "Failed to find data connection with serialized hash %d", lhsTypeHash);
GS_ASSERT(conn != nullptr, "Failed to find data connection with serialized hash");
conn = conn->Clone();

// setup sockets
Expand Down

0 comments on commit f58e288

Please sign in to comment.