Skip to content

Protobuf v6 support #396

@Tradias

Description

@Tradias

Some functions now return absl::string_view instead of const std::string& which seems to cause a compilation error in steamnetworkingsockets_internal.h:674. String_view has no c_str member function. See potential patch:

diff --git a/src/steamnetworkingsockets/steamnetworkingsockets_internal.h b/src/steamnetworkingsockets/steamnetworkingsockets_internal.h
index d5b0a97..ecaa53d 100644
--- a/src/steamnetworkingsockets/steamnetworkingsockets_internal.h
+++ b/src/steamnetworkingsockets/steamnetworkingsockets_internal.h
@@ -674,7 +674,7 @@ extern bool BSteamNetworkingIdentityToProtobufInternal( const SteamNetworkingIde
 #define SteamNetworkingIdentityToProtobuf( identity, msg, field_identity_string, field_identity_legacy_binary, field_legacy_steam_id ) \
 	{ SteamDatagramErrMsg identityToProtobufErrMsg; \
 		if ( !BSteamNetworkingIdentityToProtobuf( identity, msg, field_identity_string, field_identity_legacy_binary, field_legacy_steam_id, identityToProtobufErrMsg ) ) { \
-			AssertMsg2( false, "Failed to serialize identity to %s message.  %s", msg.GetTypeName().c_str(), identityToProtobufErrMsg ); \
+			AssertMsg2( false, "Failed to serialize identity to %s message.  %s", std::string(msg.GetTypeName()).c_str(), identityToProtobufErrMsg ); \
 		} \
 	}
 

Protobuf migration guide: https://protobuf.dev/support/migration/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions