appl/tests: auditdns eliminate use of 'restrict' keyword if !C99

The 'restrict' keyword was introduced in C99 and provides a hint to
the compiler that can be used to better optimized code.  The 'restrict'
keyword results in build failures when the compiler is not C99.

  auditdns.c:101:37: error: expected ‘;’, ‘,’ or ‘)’ before ‘hints’
     const struct addrinfo *restrict hints,
                                     ^
  auditdns.c:409:45: error: expected ‘;’, ‘,’ or ‘)’ before ‘sa’
     getnameinfo(const struct sockaddr *restrict sa, socklen_t salen,
                                                 ^

This change defines 'register' to nothing if the compiler does not
implement the C99 standard.

Observed with gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44).
This commit is contained in:
Jeffrey Altman 2024-09-03 10:16:05 -04:00
parent 2262e19a40
commit ec37879038

@ -40,6 +40,10 @@
#include "resolve.h"
#include "roken.h"
#if (__STDC_VERSION__ - 0) < 199901L
# define restrict /* empty */
#endif
struct rk_dns_reply *
rk_dns_lookup(const char *domain, const char *type_name)
{