/* Class autosprintf - formatted output to an ostream.
- Copyright (C) 2002, 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2012-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
#ifndef _AUTOSPRINTF_H
#define _AUTOSPRINTF_H
-/* This feature is available in gcc versions 2.5 and later. */
-#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
+/* This feature is available in gcc versions 2.5 and later and in clang. */
+#if !((__GNUC__ >= 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || defined __clang__) && !__STRICT_ANSI__)
# define _AUTOSPRINTF_ATTRIBUTE_FORMAT() /* empty */
#else
-/* The __-protected variants of 'format' and 'printf' attributes
- are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
+/* The __-protected variants of 'format' and 'printf' attributes are
+ accepted by gcc versions 2.6.4 (effectively 2.7) and later and in clang. */
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || defined __clang__
# define _AUTOSPRINTF_ATTRIBUTE_FORMAT() \
__attribute__ ((__format__ (__printf__, 2, 3)))
# else
/* vsprintf with automatic memory allocation.
- Copyright (C) 2002-2003, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2002-2003, 2012-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
#include <stdarg.h>
#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
+/* This feature is available in gcc versions 2.5 and later and in clang. */
+# if !((__GNUC__ >= 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || defined __clang__) && !__STRICT_ANSI__)
# define __attribute__(Spec) /* empty */
# endif
-/* The __-protected variants of 'format' and 'printf' attributes
- are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
+/* The __-protected variants of 'format' and 'printf' attributes are
+ accepted by gcc versions 2.6.4 (effectively 2.7) and later and in clang. */
+# if !(__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || defined __clang__)
# define __format__ format
# define __printf__ printf
# endif
/* Public API for GNU gettext PO files - contained in libgettextpo.
- Copyright (C) 2003-2025 Free Software Foundation, Inc.
+ Copyright (C) 2003-2026 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software: you can redistribute it and/or modify
Must not return if STATUS is nonzero. */
void (*error) (int status, int errnum,
const char *format, ...)
-#if ((__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3) && !__STRICT_ANSI__
+#if (((__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3) || defined __clang__) && !__STRICT_ANSI__
__attribute__ ((__format__ (__printf__, 3, 4)))
#endif
;
void (*error_at_line) (int status, int errnum,
const char *filename, unsigned int lineno,
const char *format, ...)
-#if ((__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3) && !__STRICT_ANSI__
+#if (((__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3) || defined __clang__) && !__STRICT_ANSI__
__attribute__ ((__format__ (__printf__, 5, 6)))
#endif
;
/* Format strings.
- Copyright (C) 2001-2025 Free Software Foundation, Inc.
+ Copyright (C) 2001-2026 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software: you can redistribute it and/or modify
/* This type of callback is responsible for showing an error. */
typedef void (*formatstring_error_logger_t) (void *data, const char *format, ...)
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
+#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) || defined __clang__
__attribute__ ((__format__ (__printf__, 2, 3)))
#endif
;
/* Error handling during reading of input files.
- Copyright (C) 2023-2025 Free Software Foundation, Inc.
+ Copyright (C) 2023-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
extern void if_error (int severity,
const char *filename, size_t lineno, size_t column,
bool multiline, const char *format, ...)
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
+#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) || defined __clang__
__attribute__ ((__format__ (__printf__, 6, 7)))
#endif
;
extern void if_verror (int severity,
const char *filename, size_t lineno, size_t column,
bool multiline, const char *format, va_list args)
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
+#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) || defined __clang__
__attribute__ ((__format__ (__printf__, 6, 0)))
#endif
;
/* Checking of messages in PO files.
- Copyright (C) 1995-2025 Free Software Foundation, Inc.
+ Copyright (C) 1995-2026 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, April 1995.
This program is free software: you can redistribute it and/or modify
};
static void
formatstring_error_logger (void *data, const char *format, ...)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || __GNUC__ > 2)
+#if (defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || __GNUC__ > 2)) || defined __clang__
__attribute__ ((__format__ (__printf__, 2, 3)))
#endif
;
/* Merging a .po file with a .pot file.
- Copyright (C) 1995-2025 Free Software Foundation, Inc.
+ Copyright (C) 1995-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
occurred at all. */
static void
silent_error_logger (void *data, const char *format, ...)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || __GNUC__ > 2)
+#if (defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || __GNUC__ > 2)) || defined __clang__
__attribute__ ((__format__ (__printf__, 2, 3)))
#endif
;
/* Error handling during reading and writing of PO files.
- Copyright (C) 2004-2025 Free Software Foundation, Inc.
+ Copyright (C) 2004-2026 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2004.
This program is free software: you can redistribute it and/or modify
#define _PO_ERROR_H
#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
+/* This feature is available in gcc versions 2.5 and later and in clang. */
+# if !((__GNUC__ >= 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || defined __clang__) && !__STRICT_ANSI__)
# define __attribute__(Spec) /* empty */
# endif
-/* The __-protected variants of 'format' and 'printf' attributes
- are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
+/* The __-protected variants of 'format' and 'printf' attributes are
+ accepted by gcc versions 2.6.4 (effectively 2.7) and later and in clang. */
+# if !(__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || defined __clang__)
# define __format__ format
# define __printf__ printf
# endif
extern LIBGETTEXTSRC_DLL_VARIABLE
void (*po_error) (int status, int errnum,
const char *format, ...)
-#if (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3
+#if ((__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3) || defined __clang__
__attribute__ ((__format__ (__printf__, 3, 4)))
#endif
;
void (*po_error_at_line) (int status, int errnum,
const char *filename, unsigned int lineno,
const char *format, ...)
-#if (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3
+#if ((__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3) || defined __clang__
__attribute__ ((__format__ (__printf__, 5, 6)))
#endif
;
/* GNU gettext - internationalization aids
- Copyright (C) 1995-2024 Free Software Foundation, Inc.
+ Copyright (C) 1995-2026 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
#include "read-catalog-abstract.h"
#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
+/* This feature is available in gcc versions 2.5 and later and in clang. */
+# if !((__GNUC__ >= 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || defined __clang__) && !__STRICT_ANSI__)
# define __attribute__(Spec) /* empty */
# endif
-/* The __-protected variants of 'format' and 'printf' attributes
- are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
+/* The __-protected variants of 'format' and 'printf' attributes are
+ accepted by gcc versions 2.6.4 (effectively 2.7) and later and in clang. */
+# if !(__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || defined __clang__)
# define __format__ format
# define __printf__ printf
# endif
};
static void
formatstring_error_logger (void *data, const char *format, ...)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || __GNUC__ > 2)
+#if (defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || __GNUC__ > 2)) || defined __clang__
__attribute__ ((__format__ (__printf__, 2, 3)))
#endif
;
/* Abstract output stream data type.
- Copyright (C) 2006, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2019-2026 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This program is free software: you can redistribute it and/or modify
Returns the size of formatted output, or a negative value in case of an
error. */
extern ptrdiff_t ostream_printf (ostream_t stream, const char *format, ...)
-#if (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3
+#if (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3 || defined __clang__
__attribute__ ((__format__ (__printf__, 2, 3)))
#endif
;
extern ptrdiff_t ostream_vprintf (ostream_t stream,
const char *format, va_list args)
-#if (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3
+#if (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3 || defined __clang__
__attribute__ ((__format__ (__printf__, 2, 0)))
#endif
;