Skip to content

Added support for metadata field in NFriend and some compilation tweaks#197

Closed
Cry-Luca wants to merge 5 commits into
heroiclabs:masterfrom
Cry-Luca:master
Closed

Added support for metadata field in NFriend and some compilation tweaks#197
Cry-Luca wants to merge 5 commits into
heroiclabs:masterfrom
Cry-Luca:master

Conversation

@Cry-Luca
Copy link
Copy Markdown
Contributor

I wanted to create separate pull requests, but I guess it was my bad for not creating branches.
I know the static library related change could be controversial, feel free to ignore it.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 23, 2026

CLA assistant check
All committers have signed the CLA.

@redbaron
Copy link
Copy Markdown
Contributor

redbaron commented May 1, 2026

@Cry-Luca , there are 4 changes which really should be reviewed separately. They seem to be very localised and don't overlap in files changed, so it should be easy to unpack it into multiple commits.

  • expose metadata: ✅
  • what seems like a beginning of -fno-cxx-exceptions support? Or that is something else? Also, some macros like _TRY_BEGIN seem to be missing from the change.
  • libHTTPClient bump: ✅ (needs testing)
  • what seems like a control over NAKAMA_API value for the purpose of using the code in a static library.

On the last point: we have excluded static library from officially provided build method because of numerous support issues regarding dependencies symbol visibility (not possible to control in static builds) as well as complications with reproducing bugs in such builds: with a DLL we can just drop it into a local env and have a look. Even if we have no intention to support static builds, we can make small change to accept the NAKAMA_API value externally:

#pragma once

// That's where FORCE_DLL_IMPORT_EXPORT might be defined on some platforms
#include <nakama-cpp/config.h>

#ifndef NAKAMA_API

#if defined _WIN32 || defined __CYGWIN__  || defined FORCE_DLL_IMPORT_EXPORT
    #ifdef NAKAMA_SHARED_LIBRARY_EXPORTS
        #define NAKAMA_API __declspec(dllexport)
    #else
        #define NAKAMA_API __declspec(dllimport)
    #endif
#elif __GNUC__ >= 4 || defined FORCE_DLL_VISIBILITY
    #ifdef NAKAMA_SHARED_LIBRARY_EXPORTS
        #define NAKAMA_API __attribute__((visibility("default")))
    #else
        #define NAKAMA_API
    #endif
#else
    #define NAKAMA_API
#endif

#endif // NAKAMA_API

then any users of the SDK are free to set NAKAMA_API themselves as they see fit and bear full responsibility for doing so consistently and in accordance with their build platform requirements. WDYT?

@Cry-Luca Cry-Luca closed this May 4, 2026
@Cry-Luca
Copy link
Copy Markdown
Contributor Author

Cry-Luca commented May 4, 2026

Closed: will create separate pull requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants