Skip to content

Commit b60b77f

Browse files
zhangxy988rpavlik
andauthored
Add static keyword to avoid -Wmissing-prototypes (#345)
* Add `static` keyword to avoid -Wmissing-prototypes When compiling the code on mac catalyst (which uses IOS SDK), I ran into a compiler error with `-Werror -Wmissing-prototypes`. * changelog fragment Co-authored-by: Ryan Pavlik <ryan.pavlik@collabora.com>
1 parent b88b7e7 commit b60b77f

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
loader: Minor changes to fix a missing-prototypes warning/error.

src/loader/loader_core.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
// Global loader lock to:
3636
// 1. Ensure ActiveLoaderInstance get and set operations are done atomically.
3737
// 2. Ensure RuntimeInterface isn't used to unload the runtime while the runtime is in use.
38-
std::mutex &GetGlobalLoaderMutex() {
38+
static std::mutex &GetGlobalLoaderMutex() {
3939
static std::mutex loader_mutex;
4040
return loader_mutex;
4141
}
@@ -58,6 +58,8 @@ static XRAPI_ATTR XrResult XRAPI_CALL LoaderXrTermDestroyDebugUtilsMessengerEXT(
5858
static XRAPI_ATTR XrResult XRAPI_CALL LoaderXrTermSubmitDebugUtilsMessageEXT(
5959
XrInstance instance, XrDebugUtilsMessageSeverityFlagsEXT messageSeverity, XrDebugUtilsMessageTypeFlagsEXT messageTypes,
6060
const XrDebugUtilsMessengerCallbackDataEXT *callbackData);
61+
static XRAPI_ATTR XrResult XRAPI_CALL LoaderXrGetInstanceProcAddr(XrInstance instance, const char *name,
62+
PFN_xrVoidFunction *function);
6163

6264
// Utility template function meant to validate if a fixed size string contains
6365
// a null-terminator.

0 commit comments

Comments
 (0)