glib/gtimezone.c: Declare Unix-only functions under G_OS_UNIX

Fixes the following warnings on CLang when compiling for Windows:

  ../glib/glib/gtimezone.c:95:22: warning: unused function 'gint64_from_be' [-Wunused-function]
  static inline gint64 gint64_from_be (const gint64_be be) {
                       ^
  ../glib/glib/gtimezone.c:99:22: warning: unused function 'gint32_from_be' [-Wunused-function]
  static inline gint32 gint32_from_be (const gint32_be be) {
                       ^
  ../glib/glib/gtimezone.c:103:23: warning: unused function 'guint32_from_be' [-Wunused-function]
  static inline guint32 guint32_from_be (const guint32_be be) {
                        ^
This commit is contained in:
Luca Bacci 2023-10-12 10:21:55 +02:00
parent 5400f4e128
commit 107311afce

View File

@ -92,6 +92,8 @@ typedef struct { gchar bytes[8]; } gint64_be;
typedef struct { gchar bytes[4]; } gint32_be;
typedef struct { gchar bytes[4]; } guint32_be;
#ifdef G_OS_UNIX
static inline gint64 gint64_from_be (const gint64_be be) {
gint64 tmp; memcpy (&tmp, &be, sizeof tmp); return GINT64_FROM_BE (tmp);
}
@ -104,6 +106,8 @@ static inline guint32 guint32_from_be (const guint32_be be) {
guint32 tmp; memcpy (&tmp, &be, sizeof tmp); return GUINT32_FROM_BE (tmp);
}
#endif
/* The layout of an IANA timezone file header */
struct tzhead
{