gwin32: Un-hide symbols when building GIR

The win32-specific APIs in GLib are only defined when building for
Windows. Unfortunately, this means they can not show up in `GLib-2.0.gir`
if it’s build on Linux (which is what mostly happens).

Consequently, that means they’re not present in the API documentation,
which is a bit of a problem.

Make the symbols in the header available on other platforms
(particularly Linux) if building with `g-ir-scanner` (but not
otherwise). This means the win32 symbols show up in `GLib-2.0.gir` and
hence in the documentation.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
This commit is contained in:
Philip Withnall 2023-11-23 14:40:25 +00:00
parent aec0f4d938
commit 50d432c77b

View File

@ -33,7 +33,7 @@
#include <glib/gtypes.h>
#ifdef G_PLATFORM_WIN32
#if defined(G_PLATFORM_WIN32) || defined(__GI_SCANNER__)
G_BEGIN_DECLS
@ -41,7 +41,7 @@ G_BEGIN_DECLS
#define MAXPATHLEN 1024
#endif
#ifdef G_OS_WIN32
#if defined(G_OS_WIN32) || defined(__GI_SCANNER__)
/*
* To get prototypes for the following POSIXish functions, you have to
@ -68,7 +68,7 @@ G_BEGIN_DECLS
GLIB_AVAILABLE_IN_ALL
gint g_win32_ftruncate (gint f,
guint size);
#endif /* G_OS_WIN32 */
#endif /* G_OS_WIN32 || __GI_SCANNER__ */
/* The MS setlocale uses locale names of the form "English_United
* States.1252" etc. We want the Unixish standard form "en", "zh_TW"
@ -137,6 +137,6 @@ gboolean g_win32_check_windows_version (const gint major,
G_END_DECLS
#endif /* G_PLATFORM_WIN32 */
#endif /* G_PLATFORM_WIN32 || __GI_SCANNER__ */
#endif /* __G_WIN32_H__ */