|
37 | 37 | * Macros and functions that may be missing on some operating systems.
|
38 | 38 | */
|
39 | 39 |
|
40 |
| -#ifndef __GNUC_PREREQ__ |
41 |
| -# ifdef __GNUC__ |
42 |
| -# define __GNUC_PREREQ__(ma, mi) \ |
43 |
| - ((__GNUC__ > (ma)) || (__GNUC__ == (ma) && __GNUC_MINOR__ >= (mi))) |
44 |
| -# else |
45 |
| -# define __GNUC_PREREQ__(ma, mi) 0 |
46 |
| -# endif |
47 |
| -#endif |
48 |
| - |
49 |
| -/* Define away __attribute__ for non-gcc or old gcc */ |
50 |
| -#if !defined(__attribute__) && !__GNUC_PREREQ__(2, 5) |
51 |
| -# define __attribute__(x) |
52 |
| -#endif |
53 |
| - |
54 |
| -/* For malloc-like functions that return uninitialized or zeroed memory. */ |
55 |
| -#ifndef __malloc |
56 |
| -# if __GNUC_PREREQ__(2, 96) |
57 |
| -# define __malloc __attribute__((__malloc__)) |
58 |
| -# else |
59 |
| -# define __malloc |
60 |
| -# endif |
61 |
| -#endif |
62 |
| - |
63 |
| -/* For catching format string mismatches */ |
64 |
| -#ifndef __printflike |
65 |
| -# if __GNUC_PREREQ__(3, 3) |
66 |
| -# define __printflike(f, v) __attribute__((__format__ (__printf__, f, v))) __attribute__((__nonnull__ (f))) |
67 |
| -# elif __GNUC_PREREQ__(2, 7) |
68 |
| -# define __printflike(f, v) __attribute__((__format__ (__printf__, f, v))) |
69 |
| -# else |
70 |
| -# define __printflike(f, v) |
71 |
| -# endif |
72 |
| -#endif |
73 |
| -#ifndef __printf0like |
74 |
| -# if __GNUC_PREREQ__(2, 7) |
75 |
| -# define __printf0like(f, v) __attribute__((__format__ (__printf__, f, v))) |
76 |
| -# else |
77 |
| -# define __printf0like(f, v) |
78 |
| -# endif |
79 |
| -#endif |
80 |
| -#ifndef __format_arg |
81 |
| -# if __GNUC_PREREQ__(2, 7) |
82 |
| -# define __format_arg(f) __attribute__((__format_arg__ (f))) |
83 |
| -# else |
84 |
| -# define __format_arg(f) |
85 |
| -# endif |
86 |
| -#endif |
87 |
| - |
88 | 40 | #ifdef HAVE_FALLTHROUGH_ATTRIBUTE
|
89 | 41 | # define FALLTHROUGH __attribute__((__fallthrough__))
|
90 | 42 | #else
|
@@ -493,22 +445,22 @@ sudo_dso_public int sudo_futimens(int fd, const struct timespec *times);
|
493 | 445 | # define futimens(_a, _b) sudo_futimens((_a), (_b))
|
494 | 446 | #endif /* HAVE_FUTIMENS */
|
495 | 447 | #if !defined(HAVE_SNPRINTF) || defined(PREFER_PORTABLE_SNPRINTF)
|
496 |
| -sudo_dso_public int sudo_snprintf(char *str, size_t n, char const *fmt, ...) __printflike(3, 4); |
| 448 | +sudo_dso_public int sudo_snprintf(char *str, size_t n, char const *fmt, ...) sudo_printflike(3, 4); |
497 | 449 | # undef snprintf
|
498 | 450 | # define snprintf sudo_snprintf
|
499 | 451 | #endif /* HAVE_SNPRINTF */
|
500 | 452 | #if !defined(HAVE_VSNPRINTF) || defined(PREFER_PORTABLE_SNPRINTF)
|
501 |
| -sudo_dso_public int sudo_vsnprintf(char *str, size_t n, const char *fmt, va_list ap) __printflike(3, 0); |
| 453 | +sudo_dso_public int sudo_vsnprintf(char *str, size_t n, const char *fmt, va_list ap) sudo_printflike(3, 0); |
502 | 454 | # undef vsnprintf
|
503 | 455 | # define vsnprintf sudo_vsnprintf
|
504 | 456 | #endif /* HAVE_VSNPRINTF */
|
505 | 457 | #if !defined(HAVE_ASPRINTF) || defined(PREFER_PORTABLE_SNPRINTF)
|
506 |
| -sudo_dso_public int sudo_asprintf(char **str, char const *fmt, ...) __printflike(2, 3); |
| 458 | +sudo_dso_public int sudo_asprintf(char **str, char const *fmt, ...) sudo_printflike(2, 3); |
507 | 459 | # undef asprintf
|
508 | 460 | # define asprintf sudo_asprintf
|
509 | 461 | #endif /* HAVE_ASPRINTF */
|
510 | 462 | #if !defined(HAVE_VASPRINTF) || defined(PREFER_PORTABLE_SNPRINTF)
|
511 |
| -sudo_dso_public int sudo_vasprintf(char **str, const char *fmt, va_list ap) __printflike(2, 0); |
| 463 | +sudo_dso_public int sudo_vasprintf(char **str, const char *fmt, va_list ap) sudo_printflike(2, 0); |
512 | 464 | # undef vasprintf
|
513 | 465 | # define vasprintf sudo_vasprintf
|
514 | 466 | #endif /* HAVE_VASPRINTF */
|
|
0 commit comments