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