summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2014-11-17 13:39:00 +0000
committerngie <ngie@FreeBSD.org>2014-11-17 13:39:00 +0000
commit8177391ac84430aeb73987802ea58e8bfe9ba72b (patch)
tree5afba437c6e7f13eeeb63c7313aa547c8c24536d /contrib/netbsd-tests
parente5d03fbe91f9f0c573d55b2d87f2a1eb517ba14b (diff)
downloadFreeBSD-src-8177391ac84430aeb73987802ea58e8bfe9ba72b.zip
FreeBSD-src-8177391ac84430aeb73987802ea58e8bfe9ba72b.tar.gz
Mechanically replace #if defined(__FreeBSD__) and #if defined(__NetBSD__) with
their #ifdef equivalents for everything changed in contrib/netbsd-tests. There are some items from the vendor tree that use #if defined(__FreeBSD__) or #if defined(__NetBSD__) which are being left alone Requested by: bde, rpaulo Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'contrib/netbsd-tests')
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c6
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_getcwd.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_glob.c8
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c4
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_nice.c14
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_raise.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c4
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_siginfo.c6
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_time.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_ttyname.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c4
-rw-r--r--contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c6
-rw-r--r--contrib/netbsd-tests/lib/libc/locale/t_wcstod.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/locale/t_wctomb.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/net/t_ether_aton.c16
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/debug.c8
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/t_exhaust.c8
-rw-r--r--contrib/netbsd-tests/lib/libc/regex/t_regex_att.c6
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/h_atexit.c4
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c4
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/t_hsearch.c8
-rw-r--r--contrib/netbsd-tests/lib/libc/string/t_memcpy.c4
-rw-r--r--contrib/netbsd-tests/lib/libc/string/t_strerror.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_access.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_clock_gettime.c4
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_getgroups.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_getrusage.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_kevent.c4
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_listen.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_msgrcv.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_pipe2.c14
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_poll.c4
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_revoke.c6
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c4
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_stat.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_timer_create.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_unlink.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_write.c6
-rw-r--r--contrib/netbsd-tests/lib/libc/time/t_strptime.c10
-rw-r--r--contrib/netbsd-tests/lib/libc/tls/dso/h_tls_dlopen.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/tls/t_tls_dlopen.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/tls/t_tls_dynamic.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/tls/t_tls_static.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/tls/t_tls_static_helper.c2
-rw-r--r--contrib/netbsd-tests/lib/libc/tls_dso/h_tls_dynamic.c2
-rw-r--r--contrib/netbsd-tests/lib/libpthread/h_atexit.c2
-rw-r--r--contrib/netbsd-tests/lib/libpthread/t_detach.c2
52 files changed, 109 insertions, 109 deletions
diff --git a/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c
index e998249..5bbf337 100644
--- a/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c
+++ b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c
@@ -31,7 +31,7 @@
*/
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
#include <sys/stat.h>
#endif
#include <atf-c.h>
@@ -251,7 +251,7 @@ ATF_TC_BODY(t_spawn_open_nonexistent, tc)
posix_spawn_file_actions_destroy(&fa);
}
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
ATF_TC(t_spawn_open_nonexistent_diag);
ATF_TC_HEAD(t_spawn_open_nonexistent_diag, tc)
@@ -381,7 +381,7 @@ ATF_TP_ADD_TCS(tp)
{
ATF_TP_ADD_TC(tp, t_spawn_fileactions);
ATF_TP_ADD_TC(tp, t_spawn_open_nonexistent);
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
ATF_TP_ADD_TC(tp, t_spawn_open_nonexistent_diag);
#endif
ATF_TP_ADD_TC(tp, t_spawn_reopen);
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_getcwd.c b/contrib/netbsd-tests/lib/libc/gen/t_getcwd.c
index bb3baf0..1f39984 100644
--- a/contrib/netbsd-tests/lib/libc/gen/t_getcwd.c
+++ b/contrib/netbsd-tests/lib/libc/gen/t_getcwd.c
@@ -56,7 +56,7 @@ ATF_TC_BODY(getcwd_err, tc)
ATF_REQUIRE(getcwd(buf, 0) == NULL);
ATF_REQUIRE(errno == EINVAL);
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
errno = 0;
ATF_REQUIRE(getcwd((void *)-1, sizeof(buf)) == NULL);
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_glob.c b/contrib/netbsd-tests/lib/libc/gen/t_glob.c
index 1611bfa..198148c 100644
--- a/contrib/netbsd-tests/lib/libc/gen/t_glob.c
+++ b/contrib/netbsd-tests/lib/libc/gen/t_glob.c
@@ -46,7 +46,7 @@ __RCSID("$NetBSD: t_glob.c,v 1.3 2013/01/02 11:28:48 martin Exp $");
#include <string.h>
#include <errno.h>
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
#include "h_macros.h"
#define __gl_stat_t struct stat
#define _S_IFDIR S_IFDIR
@@ -138,7 +138,7 @@ gl_readdir(void *v)
dir.d_ino = dd->pos;
dir.d_type = f->dir ? DT_DIR : DT_REG;
DPRINTF(("readdir %s %d\n", dir.d_name, dir.d_type));
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
dir.d_reclen = -1; /* Does not have _DIRENT_RECLEN */
#else
dir.d_reclen = _DIRENT_RECLEN(&dir, dir.d_namlen);
@@ -223,7 +223,7 @@ run(const char *p, int flags, const char **res, size_t len)
}
-#if !defined(__FreeBSD__)
+#ifndef __FreeBSD__
ATF_TC(glob_star);
ATF_TC_HEAD(glob_star, tc)
{
@@ -272,7 +272,7 @@ ATF_TC_BODY(glob_nocheck, tc)
ATF_TP_ADD_TCS(tp)
{
-#if !defined(__FreeBSD__)
+#ifndef __FreeBSD__
ATF_TP_ADD_TC(tp, glob_star);
#endif
ATF_TP_ADD_TC(tp, glob_star_not);
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c b/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c
index eec2d10..5836c86 100644
--- a/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c
+++ b/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c
@@ -34,7 +34,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
#include <libutil.h>
#else
#include <util.h>
@@ -82,7 +82,7 @@ const struct hnopts {
/*
* Truncated output. Rev. 1.7 produces "1.0 K".
*/
-#if !defined(__FreeBSD__)
+#ifndef __FreeBSD__
{ 6, 1000, "A", HN_AUTOSCALE, HN_DECIMAL, -1, "" },
/*
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_nice.c b/contrib/netbsd-tests/lib/libc/gen/t_nice.c
index a0e912b..10b8df7 100644
--- a/contrib/netbsd-tests/lib/libc/gen/t_nice.c
+++ b/contrib/netbsd-tests/lib/libc/gen/t_nice.c
@@ -72,7 +72,7 @@ ATF_TC_BODY(nice_err, tc)
{
int i;
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
atf_tc_expect_fail("nice(incr) with incr < 0 fails with unprivileged "
"users and sets errno == EPERM; see PR # 189821 for more details");
#endif
@@ -98,7 +98,7 @@ ATF_TC_HEAD(nice_priority, tc)
ATF_TC_BODY(nice_priority, tc)
{
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
int i, pri, pri2, nic;
#else
int i, pri, nic;
@@ -115,7 +115,7 @@ ATF_TC_BODY(nice_priority, tc)
pri = getpriority(PRIO_PROCESS, 0);
ATF_REQUIRE(errno == 0);
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
if (nic != pri)
atf_tc_fail("nice(3) and getpriority(2) conflict");
#endif
@@ -130,14 +130,14 @@ ATF_TC_BODY(nice_priority, tc)
if (pid == 0) {
errno = 0;
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
pri = getpriority(PRIO_PROCESS, 0);
#else
pri2 = getpriority(PRIO_PROCESS, 0);
#endif
ATF_REQUIRE(errno == 0);
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
if (pri != pri2)
#else
if (nic != pri)
@@ -180,7 +180,7 @@ ATF_TC_HEAD(nice_thread, tc)
ATF_TC_BODY(nice_thread, tc)
{
pthread_t tid[5];
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
int pri, rv, val;
#else
int rv, val;
@@ -196,7 +196,7 @@ ATF_TC_BODY(nice_thread, tc)
val = nice(i);
ATF_REQUIRE(val != -1);
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
pri = getpriority(PRIO_PROCESS, 0);
rv = pthread_create(&tid[i], NULL, threadfunc, &pri);
#else
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_raise.c b/contrib/netbsd-tests/lib/libc/gen/t_raise.c
index 120981f..d6f888f 100644
--- a/contrib/netbsd-tests/lib/libc/gen/t_raise.c
+++ b/contrib/netbsd-tests/lib/libc/gen/t_raise.c
@@ -43,7 +43,7 @@ static int count;
static void handler_err(int);
static void handler_ret(int);
static void handler_stress(int);
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
static int sig[] = { SIGALRM, SIGIO, SIGUSR1, SIGUSR2 };
#else
static int sig[] = { SIGALRM, SIGIO, SIGUSR1, SIGUSR2, SIGPWR };
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c b/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c
index a93083a..f51eb2a 100644
--- a/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c
+++ b/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c
@@ -63,7 +63,7 @@ ATF_TC_BODY(setdomainname_basic, tc)
(void)memset(name, 0, sizeof(name));
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
/*
* Sanity checks to ensure that the wrong invariant isn't being
* tested for per PR # 181127
@@ -101,7 +101,7 @@ ATF_TC_BODY(setdomainname_limit, tc)
(void)memset(name, 0, sizeof(name));
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
ATF_REQUIRE(setdomainname(name, MAXHOSTNAMELEN - 1 ) == 0);
ATF_REQUIRE(setdomainname(name, MAXHOSTNAMELEN) == -1);
#endif
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c b/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c
index 6dc7953..9c9a3c7 100644
--- a/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c
+++ b/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c
@@ -28,7 +28,7 @@
#include <atf-c.h>
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
#include <sys/inttypes.h>
#endif
#include <sys/resource.h>
@@ -87,7 +87,7 @@ sig_debug(int signo, siginfo_t *info, ucontext_t *ctx)
printf("uc_stack %p %lu 0x%x\n", ctx->uc_stack.ss_sp,
(unsigned long)ctx->uc_stack.ss_size,
ctx->uc_stack.ss_flags);
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
for (i = 0; i < __arraycount(ctx->uc_mcontext.__gregs); i++)
printf("uc_mcontext.greg[%d] 0x%lx\n", i,
(long)ctx->uc_mcontext.__gregs[i]);
@@ -144,7 +144,7 @@ sigchild_action(int signo, siginfo_t *info, void *ptr)
printf("si_uid=%d\n", info->si_uid);
printf("si_pid=%d\n", info->si_pid);
printf("si_status=%d\n", info->si_status);
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
printf("si_utime=%lu\n", (unsigned long int)info->si_utime);
printf("si_stime=%lu\n", (unsigned long int)info->si_stime);
#endif
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_time.c b/contrib/netbsd-tests/lib/libc/gen/t_time.c
index 21e625f..790f3ca 100644
--- a/contrib/netbsd-tests/lib/libc/gen/t_time.c
+++ b/contrib/netbsd-tests/lib/libc/gen/t_time.c
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_time.c,v 1.2 2011/11/11 05:03:38 jruoho Exp $");
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
#include <sys/time.h>
#endif
#include <atf-c.h>
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c b/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c
index 80f5c17..bb9d264 100644
--- a/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c
+++ b/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c
@@ -107,7 +107,7 @@ ATF_TC_BODY(ttyname_r_err, tc)
ATF_REQUIRE(rv == ERANGE);
}
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
atf_tc_expect_fail("FreeBSD returns ENOTTY instead of EBADF; see bin/191936");
#endif
rv = ttyname_r(-1, buf, ttymax);
diff --git a/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c b/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c
index 7cab973..8b3876f 100644
--- a/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c
+++ b/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c
@@ -132,7 +132,7 @@ h_ctype2(const struct test *t, bool use_mbstate)
size_t n;
ATF_REQUIRE_STREQ(setlocale(LC_ALL, "C"), "C");
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
ATF_REQUIRE(setlocale(LC_CTYPE, t->locale) != NULL);
#else
if (setlocale(LC_CTYPE, t->locale) == NULL) {
@@ -245,7 +245,7 @@ ATF_TC_BODY(mbrtowc_internal, tc)
{
struct test *t;
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
atf_tc_expect_fail("ja_* locale fails");
#endif
for (t = &tests[0]; t->data != NULL; ++t)
diff --git a/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c b/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c
index 7395d19..f8c06d3 100644
--- a/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c
+++ b/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c
@@ -150,7 +150,7 @@ ATF_TC_BODY(mbstowcs_basic, tc)
int i;
ATF_REQUIRE_STREQ(setlocale(LC_ALL, "C"), "C");
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
ATF_REQUIRE(setlocale(LC_CTYPE, t->locale) != NULL);
#else
if (setlocale(LC_CTYPE, t->locale) == NULL) {
diff --git a/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c b/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c
index bb69060..7816260 100644
--- a/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c
+++ b/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c
@@ -76,7 +76,7 @@ h_mbtowc(const char *locale, const char *illegal, const char *legal)
char *str;
ATF_REQUIRE_STREQ(setlocale(LC_ALL, "C"), "C");
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
ATF_REQUIRE(setlocale(LC_CTYPE, locale) != NULL);
#else
if (setlocale(LC_CTYPE, locale) == NULL) {
@@ -137,13 +137,13 @@ ATF_TC_BODY(mbtowc, tc)
h_mbtowc("ja_JP.ISO2022-JP", "\033$B", "\033$B$\"\033(B");
h_mbtowc("ja_JP.SJIS", "\202", "\202\240");
h_mbtowc("ja_JP.eucJP", "\244", "\244\242");
-#if !defined(__FreeBSD__)
+#ifndef __FreeBSD__
/* Moved last as it fails */
h_mbtowc("zh_CN.GB18030", "\241", "\241\241");
#endif
h_mbtowc("zh_TW.Big5", "\241", "\241@");
h_mbtowc("zh_TW.eucTW", "\241", "\241\241");
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
atf_tc_expect_fail("zh_CN.GB18030");
h_mbtowc("zh_CN.GB18030", "\241", "\241\241");
#endif
diff --git a/contrib/netbsd-tests/lib/libc/locale/t_wcstod.c b/contrib/netbsd-tests/lib/libc/locale/t_wcstod.c
index fe7b468..8d1ef33 100644
--- a/contrib/netbsd-tests/lib/libc/locale/t_wcstod.c
+++ b/contrib/netbsd-tests/lib/libc/locale/t_wcstod.c
@@ -66,7 +66,7 @@ __RCSID("$NetBSD: t_wcstod.c,v 1.3 2011/10/01 17:56:11 christos Exp $");
#include <atf-c.h>
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
#include <stdio.h>
#endif
diff --git a/contrib/netbsd-tests/lib/libc/locale/t_wctomb.c b/contrib/netbsd-tests/lib/libc/locale/t_wctomb.c
index 06016bf..3405e97 100644
--- a/contrib/netbsd-tests/lib/libc/locale/t_wctomb.c
+++ b/contrib/netbsd-tests/lib/libc/locale/t_wctomb.c
@@ -109,7 +109,7 @@ h_wctomb(const struct test *t, char tc)
size_t sz, ret, i;
ATF_REQUIRE_STREQ(setlocale(LC_ALL, "C"), "C");
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
ATF_REQUIRE(setlocale(LC_CTYPE, t->locale) != NULL);
#else
if (setlocale(LC_CTYPE, t->locale) == NULL) {
diff --git a/contrib/netbsd-tests/lib/libc/net/t_ether_aton.c b/contrib/netbsd-tests/lib/libc/net/t_ether_aton.c
index 999aa40..2a91060 100644
--- a/contrib/netbsd-tests/lib/libc/net/t_ether_aton.c
+++ b/contrib/netbsd-tests/lib/libc/net/t_ether_aton.c
@@ -46,14 +46,14 @@ __RCSID("$NetBSD: t_ether_aton.c,v 1.1 2011/11/01 22:36:53 pgoyette Exp $");
#include <string.h>
#include <errno.h>
-#if !defined(__NetBSD__)
-#if defined(__linux__)
+#ifndef __NetBSD__
+#ifdef __linux__
#include <netinet/ether.h>
#endif
#include <net/ethernet.h>
#endif
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
#define ETHER_ADDR_LEN 6
int ether_aton_r(u_char *dest, size_t len, const char *str);
@@ -65,7 +65,7 @@ static const struct {
int error;
} tests[] = {
{ { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab }, "01:23:45:67:89:ab", 0 },
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
{ { 0x00, 0x01, 0x22, 0x03, 0x14, 0x05 }, "0:1:22-3:14:05", 0 },
{ { 0x00, 0x01, 0x22, 0x03, 0x14, 0x05 }, "000122031405", 0 },
{ { 0x0a, 0x0B, 0xcc, 0xdD, 0xEE, 0x0f }, "0a0BccdDEE0f", 0 },
@@ -86,13 +86,13 @@ ATF_TC_HEAD(tc_ether_aton, tc)
ATF_TC_BODY(tc_ether_aton, tc)
{
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
u_char dest[ETHER_ADDR_LEN];
#else
struct ether_addr dest;
#endif
size_t t;
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
int e, r;
#else
int e;
@@ -103,7 +103,7 @@ ATF_TC_BODY(tc_ether_aton, tc)
for (t = 0; tests[t].str; t++) {
s = tests[t].str;
if ((e = tests[t].error) == 0) {
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
if (ether_aton_r(dest, sizeof(dest), s) != e)
atf_tc_fail("failed on `%s'", s);
if (memcmp(dest, tests[t].res, sizeof(dest)) != 0)
@@ -115,7 +115,7 @@ ATF_TC_BODY(tc_ether_aton, tc)
atf_tc_fail("unexpected result on `%s'", s);
#endif
} else {
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
if ((r = ether_aton_r(dest, sizeof(dest), s)) != e)
atf_tc_fail("unexpectedly succeeded on `%s' "
"(%d != %d)", s, r, e);
diff --git a/contrib/netbsd-tests/lib/libc/regex/debug.c b/contrib/netbsd-tests/lib/libc/regex/debug.c
index 55655eb..f1d2b15 100644
--- a/contrib/netbsd-tests/lib/libc/regex/debug.c
+++ b/contrib/netbsd-tests/lib/libc/regex/debug.c
@@ -34,7 +34,7 @@
#include <string.h>
#include <sys/types.h>
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
#include <wchar.h>
#include <wctype.h>
#endif
@@ -54,7 +54,7 @@ static char *regchar(int);
void
regprint(regex_t *r, FILE *d)
{
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
struct re_guts *g = r->re_g;
int c;
int last;
@@ -177,7 +177,7 @@ s_print(struct re_guts *g, FILE *d)
break;
case OANYOF:
fprintf(d, "[(%ld)", (long)opnd);
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
cs = &g->sets[opnd];
last = -1;
for (size_t i = 0; i < g->csetsize+1; i++) /* +1 flushes */
@@ -250,7 +250,7 @@ s_print(struct re_guts *g, FILE *d)
fprintf(d, ">");
break;
default:
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
fprintf(d, "!%ld(%ld)!", OP(*s), opnd);
#else
fprintf(d, "!%d(%d)!", OP(*s), opnd);
diff --git a/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c b/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c
index bc34441..0670e51 100644
--- a/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c
+++ b/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c
@@ -45,7 +45,7 @@ __RCSID("$NetBSD: t_exhaust.c,v 1.7 2011/11/16 18:37:31 christos Exp $");
#include <stdlib.h>
#include <err.h>
#include <atf-c.h>
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
#include <sys/resource.h>
#endif
@@ -179,7 +179,7 @@ ATF_TC_HEAD(regcomp_too_big, tc)
" crash, but return a proper error code");
// libtre needs it.
atf_tc_set_md_var(tc, "timeout", "600");
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
atf_tc_set_md_var(tc, "require.memory", "64M");
#else
atf_tc_set_md_var(tc, "require.memory", "120M");
@@ -189,12 +189,12 @@ ATF_TC_HEAD(regcomp_too_big, tc)
ATF_TC_BODY(regcomp_too_big, tc)
{
regex_t re;
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
struct rlimit limit;
#endif
int e;
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
limit.rlim_cur = limit.rlim_max = 64 * 1024 * 1024;
ATF_REQUIRE(setrlimit(RLIMIT_VMEM, &limit) != -1);
#endif
diff --git a/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c b/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c
index fb8f285..0ca44b4 100644
--- a/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c
+++ b/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c
@@ -48,7 +48,7 @@ __RCSID("$NetBSD: t_regex_att.c,v 1.1 2012/08/24 20:24:40 jmmv Exp $");
#include <vis.h>
#include <ctype.h>
#include <atf-c.h>
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
#include <libutil.h>
#endif
@@ -377,7 +377,7 @@ checkmatches(const char *matches, size_t nm, const regmatch_t *pm,
" cur=%d, max=%zu", res, l, len - off);
off += l;
}
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
ATF_CHECK_STREQ_MSG(res, matches, " at line %zu", lineno);
#else
ATF_REQUIRE_STREQ_MSG(res, matches, " at line %zu", lineno);
@@ -580,7 +580,7 @@ ATF_TC_BODY(leftassoc, tc)
* any explation. Mark as broken here, but I don't know why. */
atf_tc_expect_fail("Reason for breakage unknown");
#endif
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
atf_tc_expect_fail("The expected and matched groups are mismatched on FreeBSD");
#endif
att_test(tc, "leftassoc");
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/h_atexit.c b/contrib/netbsd-tests/lib/libc/stdlib/h_atexit.c
index d3e1f11..c0641db 100644
--- a/contrib/netbsd-tests/lib/libc/stdlib/h_atexit.c
+++ b/contrib/netbsd-tests/lib/libc/stdlib/h_atexit.c
@@ -42,7 +42,7 @@ __RCSID("$NetBSD: h_atexit.c,v 1.1 2011/01/12 19:44:08 pgoyette Exp $");
extern int __cxa_atexit(void (*func)(void *), void *, void *);
extern void __cxa_finalize(void *);
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
/*
* On shared object unload, in __cxa_finalize, call and clear all installed
* atexit and __cxa_atexit handlers that are either installed by unloaded
@@ -191,7 +191,7 @@ main(int argc, char *argv[])
ASSERT(0 == atexit(normal_handler_0));
ASSERT(0 == atexit(normal_handler_1));
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
ASSERT(0 == __cxa_atexit(cxa_handler_4, &arg_1, dso_handle_1));
ASSERT(0 == __cxa_atexit(cxa_handler_5, &arg_1, dso_handle_1));
ASSERT(0 == __cxa_atexit(cxa_handler_3, &arg_2, dso_handle_2));
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c b/contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c
index 58ecd96..ec2b9bb 100644
--- a/contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c
+++ b/contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c
@@ -34,7 +34,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <err.h>
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
#include <libutil.h>
#endif
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c b/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c
index f5ded27..2293e2c 100644
--- a/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c
+++ b/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c
@@ -36,7 +36,7 @@
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
#include <libutil.h>
#endif
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c b/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c
index 3b0b885..5a8fa28 100644
--- a/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c
@@ -40,7 +40,7 @@ __RCSID("$NetBSD: t_getenv.c,v 1.2 2011/07/15 13:54:31 jruoho Exp $");
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
#include <signal.h>
#endif
@@ -155,7 +155,7 @@ ATF_TC_BODY(setenv_basic, tc)
ATF_CHECK_ERRNO(EINVAL, setenv(NULL, "val", 1) == -1);
ATF_CHECK_ERRNO(EINVAL, setenv("", "val", 1) == -1);
ATF_CHECK_ERRNO(EINVAL, setenv("v=r", "val", 1) == -1);
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
/*
Both FreeBSD and OS/X does not validate the second
argument to setenv(3)
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_hsearch.c b/contrib/netbsd-tests/lib/libc/stdlib/t_hsearch.c
index 3c869c4..d665967 100644
--- a/contrib/netbsd-tests/lib/libc/stdlib/t_hsearch.c
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_hsearch.c
@@ -75,7 +75,7 @@ __RCSID("$NetBSD: t_hsearch.c,v 1.4 2014/07/20 20:17:21 christos Exp $");
#define REQUIRE_ERRNO(x) ATF_REQUIRE_MSG(x, "%s", strerror(errno))
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
ATF_TC(hsearch_basic);
ATF_TC_HEAD(hsearch_basic, tc)
{
@@ -231,7 +231,7 @@ ATF_TC_BODY(hsearch_two, tc)
hdestroy();
}
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
ATF_TC(hsearch_r_basic);
ATF_TC_HEAD(hsearch_r_basic, tc)
{
@@ -389,14 +389,14 @@ ATF_TC_BODY(hsearch_r_two, tc)
ATF_TP_ADD_TCS(tp)
{
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
ATF_TP_ADD_TC(tp, hsearch_basic);
#endif
ATF_TP_ADD_TC(tp, hsearch_duplicate);
ATF_TP_ADD_TC(tp, hsearch_nonexistent);
ATF_TP_ADD_TC(tp, hsearch_two);
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
ATF_TP_ADD_TC(tp, hsearch_r_basic);
#endif
ATF_TP_ADD_TC(tp, hsearch_r_duplicate);
diff --git a/contrib/netbsd-tests/lib/libc/string/t_memcpy.c b/contrib/netbsd-tests/lib/libc/string/t_memcpy.c
index c9e52a3..192a4e8 100644
--- a/contrib/netbsd-tests/lib/libc/string/t_memcpy.c
+++ b/contrib/netbsd-tests/lib/libc/string/t_memcpy.c
@@ -51,7 +51,7 @@ unsigned char *start[BLOCKTYPES] = {
};
char result[100];
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
const char goodResult[] = "7b405d24bc03195474c70ddae9e1f8fb";
#else
const char goodResult[] = "217b4fbe456916bf62a2f85df752e4ab";
@@ -93,7 +93,7 @@ ATF_TC_BODY(memcpy_basic, tc)
start[2] = auto1;
start[3] = auto2;
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
srandom(0L);
#else
/*
diff --git a/contrib/netbsd-tests/lib/libc/string/t_strerror.c b/contrib/netbsd-tests/lib/libc/string/t_strerror.c
index cb008d7..888a826 100644
--- a/contrib/netbsd-tests/lib/libc/string/t_strerror.c
+++ b/contrib/netbsd-tests/lib/libc/string/t_strerror.c
@@ -37,7 +37,7 @@ __RCSID("$NetBSD: t_strerror.c,v 1.3 2011/05/10 06:55:27 jruoho Exp $");
#include <locale.h>
#include <string.h>
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
#include <stdio.h>
#endif
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_access.c b/contrib/netbsd-tests/lib/libc/sys/t_access.c
index 0bd6a26..b8b399e 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_access.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_access.c
@@ -40,7 +40,7 @@ __RCSID("$NetBSD: t_access.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $");
#include <atf-c.h>
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
#include <sys/stat.h>
#endif
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_clock_gettime.c b/contrib/netbsd-tests/lib/libc/sys/t_clock_gettime.c
index 37a4267..229c343 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_clock_gettime.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_clock_gettime.c
@@ -63,7 +63,7 @@ __RCSID("$NetBSD: t_clock_gettime.c,v 1.1 2011/10/15 06:42:16 jruoho Exp $");
#include <sys/param.h>
#include <sys/sysctl.h>
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
#include <machine/int_limits.h>
#endif
@@ -75,7 +75,7 @@ __RCSID("$NetBSD: t_clock_gettime.c,v 1.1 2011/10/15 06:42:16 jruoho Exp $");
#include <time.h>
#include <unistd.h>
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
#include "../../../h_macros.h"
#else
#include <limits.h>
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_getgroups.c b/contrib/netbsd-tests/lib/libc/sys/t_getgroups.c
index 12628c2..7dedca4 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_getgroups.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_getgroups.c
@@ -57,7 +57,7 @@ ATF_TC_BODY(getgroups_err, tc)
errno = 0;
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
atf_tc_expect_fail("Reported as kern/189941");
#endif
ATF_REQUIRE(getgroups(-1, gidset) == -1);
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_getrusage.c b/contrib/netbsd-tests/lib/libc/sys/t_getrusage.c
index 669c704..85eeac6 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_getrusage.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_getrusage.c
@@ -47,7 +47,7 @@ static void sighandler(int);
static const size_t maxiter = 2000;
static void
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
sighandler(int signo __unused)
#else
sighandler(int signo)
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_kevent.c b/contrib/netbsd-tests/lib/libc/sys/t_kevent.c
index 5578adc..fe298c5 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_kevent.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_kevent.c
@@ -149,11 +149,11 @@ ATF_TC_BODY(kqueue_desc_passing, tc)
printf("parent (pid %d): sending kq fd %d\n", getpid(), kq);
if (sendmsg(s[0], &m, 0) == -1) {
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
ATF_REQUIRE_EQ_MSG(errno, EBADF, "errno is %d", errno);
atf_tc_skip("PR kern/46523");
#endif
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
ATF_REQUIRE_EQ_MSG(errno, EOPNOTSUPP, "errno is %d", errno);
close(s[0]);
#endif
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_listen.c b/contrib/netbsd-tests/lib/libc/sys/t_listen.c
index 1de1e87..d7c7d9e 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_listen.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_listen.c
@@ -36,7 +36,7 @@
#include <arpa/inet.h>
#include <netinet/in.h>
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
#include <sys/socket.h>
#endif
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_msgrcv.c b/contrib/netbsd-tests/lib/libc/sys/t_msgrcv.c
index ce68336..70f8906 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_msgrcv.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_msgrcv.c
@@ -47,7 +47,7 @@ __RCSID("$NetBSD: t_msgrcv.c,v 1.3 2013/07/24 11:44:10 skrll Exp $");
#include <time.h>
#include <unistd.h>
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
#include <limits.h>
#endif
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c b/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c
index fddf5eb..d30cb7b 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c
@@ -47,7 +47,7 @@ __RCSID("$NetBSD: t_msgsnd.c,v 1.2 2011/11/05 08:47:54 jruoho Exp $");
#include <time.h>
#include <unistd.h>
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
#include <limits.h>
#endif
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c b/contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c
index 1712d81..b4d9f8a 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c
@@ -45,7 +45,7 @@ __RCSID("$NetBSD: t_nanosleep.c,v 1.3 2013/03/31 16:47:16 christos Exp $");
#include <unistd.h>
static void
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
handler(int signo __unused)
#else
handler(int signo)
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_pipe2.c b/contrib/netbsd-tests/lib/libc/sys/t_pipe2.c
index f092287..8208cf7 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_pipe2.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_pipe2.c
@@ -53,7 +53,7 @@ run(int flags)
while ((i = open("/", O_RDONLY)) < 3)
ATF_REQUIRE(i != -1);
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
closefrom(3);
#else
ATF_REQUIRE(fcntl(3, F_CLOSEM) != -1);
@@ -80,7 +80,7 @@ run(int flags)
ATF_REQUIRE((fcntl(fd[1], F_GETFL) & O_NONBLOCK) == 0);
}
-#if !defined(__FreeBSD__)
+#ifndef __FreeBSD__
if (flags & O_NOSIGPIPE) {
ATF_REQUIRE(fcntl(fd[0], F_GETNOSIGPIPE) != 0);
ATF_REQUIRE(fcntl(fd[1], F_GETNOSIGPIPE) != 0);
@@ -116,7 +116,7 @@ ATF_TC_BODY(pipe2_consume, tc)
{
struct rlimit rl;
int err, filedes[2];
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
int old;
closefrom(4);
@@ -132,7 +132,7 @@ ATF_TC_BODY(pipe2_consume, tc)
* file descriptor limit in the middle of a pipe2() call - i.e.
* before the call only a single descriptor may be openend.
*/
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
old = rl.rlim_cur;
#endif
rl.rlim_cur = 4;
@@ -141,7 +141,7 @@ ATF_TC_BODY(pipe2_consume, tc)
err = pipe2(filedes, O_CLOEXEC);
ATF_REQUIRE(err == -1);
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
rl.rlim_cur = old;
err = setrlimit(RLIMIT_NOFILE, &rl);
#endif
@@ -169,7 +169,7 @@ ATF_TC_BODY(pipe2_cloexec, tc)
run(O_CLOEXEC);
}
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
ATF_TC(pipe2_nosigpipe);
ATF_TC_HEAD(pipe2_nosigpipe, tc)
{
@@ -201,7 +201,7 @@ ATF_TP_ADD_TCS(tp)
ATF_TP_ADD_TC(tp, pipe2_consume);
ATF_TP_ADD_TC(tp, pipe2_nonblock);
ATF_TP_ADD_TC(tp, pipe2_cloexec);
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
ATF_TP_ADD_TC(tp, pipe2_nosigpipe);
#endif
ATF_TP_ADD_TC(tp, pipe2_einval);
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_poll.c b/contrib/netbsd-tests/lib/libc/sys/t_poll.c
index 805773d..6214486 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_poll.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_poll.c
@@ -233,7 +233,7 @@ ATF_TC_BODY(poll_err, tc)
ATF_REQUIRE_ERRNO(EINVAL, poll(&pfd, 1, -2) == -1);
}
-#if !defined(__FreeBSD__)
+#ifndef __FreeBSD__
ATF_TC(pollts_basic);
ATF_TC_HEAD(pollts_basic, tc)
{
@@ -386,7 +386,7 @@ ATF_TP_ADD_TCS(tp)
ATF_TP_ADD_TC(tp, poll_3way);
ATF_TP_ADD_TC(tp, poll_basic);
ATF_TP_ADD_TC(tp, poll_err);
-#if !defined(__FreeBSD__)
+#ifndef __FreeBSD__
ATF_TP_ADD_TC(tp, pollts_basic);
ATF_TP_ADD_TC(tp, pollts_err);
ATF_TP_ADD_TC(tp, pollts_sigmask);
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_revoke.c b/contrib/netbsd-tests/lib/libc/sys/t_revoke.c
index fe59cac..926d2740 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_revoke.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_revoke.c
@@ -58,7 +58,7 @@ ATF_TC_BODY(revoke_basic, tc)
size_t i, n;
int *buf;
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
atf_tc_skip("revoke(2) is only implemented for devfs(5).");
#endif
(void)memset(&res, 0, sizeof(struct rlimit));
@@ -116,7 +116,7 @@ ATF_TC_BODY(revoke_err, tc)
errno = 0;
ATF_REQUIRE_ERRNO(ENAMETOOLONG, revoke(buf) == -1);
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
atf_tc_skip("revoke(2) is only implemented for devfs(5).");
#endif
errno = 0;
@@ -139,7 +139,7 @@ ATF_TC_BODY(revoke_perm, tc)
int fd, sta;
pid_t pid;
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
atf_tc_skip("revoke(2) is only implemented for devfs(5).");
#endif
pw = getpwnam("nobody");
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c b/contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c
index ac7d3ad..6686f02 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c
@@ -46,7 +46,7 @@ static void handler(int, siginfo_t *, void *);
static int value;
static void
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
handler(int signo __unused, siginfo_t *info __unused, void *data __unused)
#else
handler(int signo, siginfo_t *info, void *data)
@@ -76,7 +76,7 @@ ATF_TC_BODY(sigqueue_basic, tc)
sv.sival_int = VALUE;
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
/*
* From kern_sig.c:
* Specification says sigqueue can only send signal to single process.
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_stat.c b/contrib/netbsd-tests/lib/libc/sys/t_stat.c
index e96d772..5e1d17e 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_stat.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_stat.c
@@ -47,7 +47,7 @@ __RCSID("$NetBSD: t_stat.c,v 1.4 2012/03/17 08:37:08 jruoho Exp $");
#include <stdio.h>
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
#include <netinet/in.h>
#endif
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_timer_create.c b/contrib/netbsd-tests/lib/libc/sys/t_timer_create.c
index 168bad7..cc85307 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_timer_create.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_timer_create.c
@@ -38,7 +38,7 @@ static timer_t t;
static bool fail = true;
static void
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
timer_signal_handler(int signo, siginfo_t *si, void *osi __unused)
#else
timer_signal_handler(int signo, siginfo_t *si, void *osi)
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_unlink.c b/contrib/netbsd-tests/lib/libc/sys/t_unlink.c
index e73e2f4..8d94668 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_unlink.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_unlink.c
@@ -85,7 +85,7 @@ ATF_TC_BODY(unlink_err, tc)
(void)memset(buf, 'x', sizeof(buf));
errno = 0;
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
ATF_REQUIRE_ERRNO(EISDIR, unlink("/") == -1);
#else
ATF_REQUIRE_ERRNO(EBUSY, unlink("/") == -1);
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_write.c b/contrib/netbsd-tests/lib/libc/sys/t_write.c
index d7a06e0..a3783cb 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_write.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_write.c
@@ -32,7 +32,7 @@ __COPYRIGHT("@(#) Copyright (c) 2008\
__RCSID("$NetBSD: t_write.c,v 1.2 2011/10/19 16:19:30 jruoho Exp $");
#include <sys/uio.h>
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
#include <sys/syslimits.h>
#endif
@@ -45,7 +45,7 @@ __RCSID("$NetBSD: t_write.c,v 1.2 2011/10/19 16:19:30 jruoho Exp $");
#include <string.h>
#include <unistd.h>
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
#include <limits.h>
#endif
@@ -55,7 +55,7 @@ static bool fail = false;
static const char *path = "write";
static void
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
sighandler(int signo __unused)
#else
sighandler(int signo)
diff --git a/contrib/netbsd-tests/lib/libc/time/t_strptime.c b/contrib/netbsd-tests/lib/libc/time/t_strptime.c
index 7808891..99871ff 100644
--- a/contrib/netbsd-tests/lib/libc/time/t_strptime.c
+++ b/contrib/netbsd-tests/lib/libc/time/t_strptime.c
@@ -49,7 +49,7 @@ h_pass(const char *buf, const char *fmt, int len,
exp = buf + len;
ret = strptime(buf, fmt, &tm);
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
ATF_CHECK_MSG(ret == exp,
"strptime(\"%s\", \"%s\", tm): incorrect return code: "
"expected: %p, got: %p", buf, fmt, exp, ret);
@@ -88,7 +88,7 @@ h_fail(const char *buf, const char *fmt)
{
struct tm tm = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, NULL };
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
ATF_CHECK_MSG(strptime(buf, fmt, &tm) == NULL, "strptime(\"%s\", "
"\"%s\", &tm) should fail, but it didn't", buf, fmt);
#else
@@ -108,7 +108,7 @@ ATF_TC_HEAD(common, tc)
ATF_TC_BODY(common, tc)
{
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
atf_tc_expect_fail("There are various issues with strptime on FreeBSD");
#endif
@@ -189,13 +189,13 @@ ATF_TC_BODY(day, tc)
h_pass("mon", "%a", 3, -1, -1, -1, -1, -1, -1, 1, -1);
h_pass("tueSDay", "%A", 7, -1, -1, -1, -1, -1, -1, 2, -1);
h_pass("sunday", "%A", 6, -1, -1, -1, -1, -1, -1, 0, -1);
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
h_fail("sunday", "%EA");
#else
h_pass("Sunday", "%EA", 6, -1, -1, -1, -1, -1, -1, 0, -1);
#endif
h_pass("SaturDay", "%A", 8, -1, -1, -1, -1, -1, -1, 6, -1);
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
h_fail("SaturDay", "%OA");
#else
h_pass("SaturDay", "%OA", 8, -1, -1, -1, -1, -1, -1, 6, -1);
diff --git a/contrib/netbsd-tests/lib/libc/tls/dso/h_tls_dlopen.c b/contrib/netbsd-tests/lib/libc/tls/dso/h_tls_dlopen.c
index 373528b..6c913a4 100644
--- a/contrib/netbsd-tests/lib/libc/tls/dso/h_tls_dlopen.c
+++ b/contrib/netbsd-tests/lib/libc/tls/dso/h_tls_dlopen.c
@@ -36,7 +36,7 @@ __RCSID("$NetBSD: h_tls_dlopen.c,v 1.5 2013/10/21 19:14:16 joerg Exp $");
#include <atf-c.h>
#include <unistd.h>
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
#include <sys/tls.h>
#endif
diff --git a/contrib/netbsd-tests/lib/libc/tls/t_tls_dlopen.c b/contrib/netbsd-tests/lib/libc/tls/t_tls_dlopen.c
index 1ebbe7d..a268068 100644
--- a/contrib/netbsd-tests/lib/libc/tls/t_tls_dlopen.c
+++ b/contrib/netbsd-tests/lib/libc/tls/t_tls_dlopen.c
@@ -39,7 +39,7 @@ __RCSID("$NetBSD: t_tls_dlopen.c,v 1.3 2012/01/17 20:34:57 joerg Exp $");
#include <pthread.h>
#include <unistd.h>
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
#include <sys/tls.h>
#endif
diff --git a/contrib/netbsd-tests/lib/libc/tls/t_tls_dynamic.c b/contrib/netbsd-tests/lib/libc/tls/t_tls_dynamic.c
index b5d1728..1982a9b 100644
--- a/contrib/netbsd-tests/lib/libc/tls/t_tls_dynamic.c
+++ b/contrib/netbsd-tests/lib/libc/tls/t_tls_dynamic.c
@@ -38,7 +38,7 @@ __RCSID("$NetBSD: t_tls_dynamic.c,v 1.3 2012/01/17 20:34:57 joerg Exp $");
#include <pthread.h>
#include <unistd.h>
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
#include <sys/tls.h>
#endif
diff --git a/contrib/netbsd-tests/lib/libc/tls/t_tls_static.c b/contrib/netbsd-tests/lib/libc/tls/t_tls_static.c
index 028f398..db0ff16 100644
--- a/contrib/netbsd-tests/lib/libc/tls/t_tls_static.c
+++ b/contrib/netbsd-tests/lib/libc/tls/t_tls_static.c
@@ -37,7 +37,7 @@ __RCSID("$NetBSD: t_tls_static.c,v 1.2 2012/01/17 20:34:57 joerg Exp $");
#include <atf-c.h>
#include <pthread.h>
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
#include <sys/tls.h>
#endif
diff --git a/contrib/netbsd-tests/lib/libc/tls/t_tls_static_helper.c b/contrib/netbsd-tests/lib/libc/tls/t_tls_static_helper.c
index a85ce9b..841b2bf 100644
--- a/contrib/netbsd-tests/lib/libc/tls/t_tls_static_helper.c
+++ b/contrib/netbsd-tests/lib/libc/tls/t_tls_static_helper.c
@@ -34,7 +34,7 @@
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_tls_static_helper.c,v 1.2 2012/01/17 20:34:57 joerg Exp $");
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
#include <sys/tls.h>
#endif
diff --git a/contrib/netbsd-tests/lib/libc/tls_dso/h_tls_dynamic.c b/contrib/netbsd-tests/lib/libc/tls_dso/h_tls_dynamic.c
index 8a82689..a5e78ff 100644
--- a/contrib/netbsd-tests/lib/libc/tls_dso/h_tls_dynamic.c
+++ b/contrib/netbsd-tests/lib/libc/tls_dso/h_tls_dynamic.c
@@ -35,7 +35,7 @@
__RCSID("$NetBSD: h_tls_dynamic.c,v 1.5 2013/10/21 19:11:17 joerg Exp $");
#include <unistd.h>
-#if defined(__NetBSD__)
+#ifdef __NetBSD__
#include <sys/tls.h>
#endif
diff --git a/contrib/netbsd-tests/lib/libpthread/h_atexit.c b/contrib/netbsd-tests/lib/libpthread/h_atexit.c
index edcf066..29b8775 100644
--- a/contrib/netbsd-tests/lib/libpthread/h_atexit.c
+++ b/contrib/netbsd-tests/lib/libpthread/h_atexit.c
@@ -180,7 +180,7 @@ main(int argc, char *argv[])
exiting_state = 5;
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
ASSERT(0 == atexit(normal_handler_0));
ASSERT(0 == atexit(normal_handler_1));
ASSERT(0 == __cxa_atexit(cxa_handler_4, &arg_1, dso_handle_1));
diff --git a/contrib/netbsd-tests/lib/libpthread/t_detach.c b/contrib/netbsd-tests/lib/libpthread/t_detach.c
index aeed671..8922d5a 100644
--- a/contrib/netbsd-tests/lib/libpthread/t_detach.c
+++ b/contrib/netbsd-tests/lib/libpthread/t_detach.c
@@ -75,7 +75,7 @@ ATF_TC_BODY(pthread_detach, tc)
rv = pthread_join(t, NULL);
ATF_REQUIRE(rv == EINVAL);
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
atf_tc_expect_fail("PR # 191906: fails with EINVAL, not ESRCH");
#endif
OpenPOWER on IntegriCloud