mark exception-safe C entry points as such
This commit is contained in:
parent
1bd1376cea
commit
b21066c89e
|
@ -3,12 +3,14 @@
|
|||
#include <glib.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#define EXTERN extern "C"
|
||||
#define NOEXCEPT noexcept
|
||||
#else
|
||||
#define EXTERN
|
||||
#define NOEXCEPT
|
||||
#endif
|
||||
|
||||
gboolean TryCreateShortcut(const gchar* aumid);
|
||||
EXTERN gboolean TryCreateShortcut(const gchar* aumid) NOEXCEPT;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#undef EXTERN
|
||||
#undef NOEXCEPT
|
||||
|
|
|
@ -12,14 +12,15 @@
|
|||
std::optional<std::wstring> GetCurrentModulePath();
|
||||
std::optional<std::wstring> GetShortcutPath();
|
||||
|
||||
#define EXTERN extern "C"
|
||||
#define NOEXCEPT noexcept
|
||||
#else
|
||||
#define EXTERN
|
||||
#define NOEXCEPT
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
gboolean SupportsModernNotifications();
|
||||
gboolean SetAppModelID(const gchar* aumid);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
EXTERN gboolean SupportsModernNotifications() NOEXCEPT;
|
||||
EXTERN gboolean SetAppModelID(const gchar* aumid) NOEXCEPT;
|
||||
|
||||
#undef EXTERN
|
||||
#undef NOEXCEPT
|
||||
|
|
|
@ -153,7 +153,7 @@ bool TryCreateShortcutInternal(const char *const aumid)
|
|||
|
||||
extern "C"
|
||||
{
|
||||
gboolean TryCreateShortcut(const gchar* aumid)
|
||||
gboolean TryCreateShortcut(const gchar* aumid) noexcept
|
||||
{
|
||||
return g_try_invoke(TryCreateShortcutInternal, aumid);
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ extern "C"
|
|||
// Not available in mingw headers, but linking works.
|
||||
NTSTATUS NTAPI RtlGetVersion(PRTL_OSVERSIONINFOW);
|
||||
|
||||
gboolean SupportsModernNotifications()
|
||||
gboolean SupportsModernNotifications() noexcept
|
||||
{
|
||||
RTL_OSVERSIONINFOW rovi = { 0 };
|
||||
rovi.dwOSVersionInfoSize = sizeof(rovi);
|
||||
|
@ -55,7 +55,7 @@ extern "C"
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean SetAppModelID(const gchar* aumid)
|
||||
gboolean SetAppModelID(const gchar* aumid) noexcept
|
||||
{
|
||||
return g_try_invoke(SetAppModelIDInternal, aumid);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue