Merge pull request #8 from Oichkatzelesfrettschen/40pmin-eirikr/replace-__netbsd__-with-minix-conditionals
Replace __NetBSD__ checks with MINIX-specific conditionals
This commit is contained in:
commit
d8c46b9ffb
|
|
@ -134,7 +134,7 @@ static const wchar_t char_shell[] = L"'`\";&<>()|{}]\\$!^~";
|
|||
static const wchar_t char_glob[] = L"*?[#";
|
||||
|
||||
#if !HAVE_NBTOOL_CONFIG_H
|
||||
#if !defined(__NetBSD__) && ! defined(__minix)
|
||||
#ifndef __minix
|
||||
/*
|
||||
* On NetBSD MB_LEN_MAX is currently 32 which does not fit on any integer
|
||||
* integral type and it is probably wrong, since currently the maximum
|
||||
|
|
@ -154,7 +154,7 @@ static const wchar_t char_glob[] = L"*?[#";
|
|||
#endif
|
||||
#endif /* __FreeBSD__ */
|
||||
CTASSERT(MB_LEN_MAX <= sizeof(uint64_t));
|
||||
#endif /* !__NetBSD__ */
|
||||
#endif /* !__minix */
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#include <sys/cdefs.h>
|
||||
#define ISC_FORMAT_PRINTF(a,b) __attribute__((__format__(__printf__,a,b)))
|
||||
#define ISC_SOCKLEN_T socklen_t
|
||||
#ifdef __NetBSD__
|
||||
#ifdef __minix
|
||||
#define DE_CONST(c,v) v = __UNCONST(c)
|
||||
#else
|
||||
#define DE_CONST(c,v) v = ((c) ? \
|
||||
|
|
|
|||
|
|
@ -97,13 +97,13 @@
|
|||
|
||||
/* LINTLIBRARY */
|
||||
|
||||
#if defined(__NetBSD__) || defined(__minix)
|
||||
#ifdef __minix
|
||||
# define xutrace(a, b) utrace("malloc", (a), (b))
|
||||
# define __DECONST(x, y) ((x)__UNCONST(y))
|
||||
# define NO_TLS
|
||||
#else
|
||||
# define xutrace(a, b) utrace((a), (b))
|
||||
#endif /* __NetBSD__ */
|
||||
#endif /* __minix */
|
||||
|
||||
/*
|
||||
* MALLOC_PRODUCTION disables assertions and statistics gathering. It also
|
||||
|
|
@ -159,7 +159,7 @@ __RCSID("$NetBSD: jemalloc.c,v 1.38 2015/07/26 17:21:55 martin Exp $");
|
|||
#include <strings.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef __NetBSD__
|
||||
#ifdef __minix
|
||||
# include <reentrant.h>
|
||||
# include "extern.h"
|
||||
|
||||
|
|
@ -184,7 +184,7 @@ __strerror_r(int e, char *s, size_t l)
|
|||
}
|
||||
return slen >= l ? ERANGE : rval;
|
||||
}
|
||||
#endif
|
||||
#endif /* __minix */
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#define STRERROR_R(a, b, c) strerror_r(a, b, c);
|
||||
|
|
@ -941,11 +941,11 @@ static bool malloc_init_hard(void);
|
|||
* Begin mutex.
|
||||
*/
|
||||
|
||||
#ifdef __NetBSD__
|
||||
#ifdef __minix
|
||||
#define malloc_mutex_init(m) mutex_init(m, NULL)
|
||||
#define malloc_mutex_lock(m) mutex_lock(m)
|
||||
#define malloc_mutex_unlock(m) mutex_unlock(m)
|
||||
#else /* __NetBSD__ */
|
||||
#else /* __minix */
|
||||
static inline void
|
||||
malloc_mutex_init(malloc_mutex_t *a_mutex)
|
||||
{
|
||||
|
|
@ -969,7 +969,7 @@ malloc_mutex_unlock(malloc_mutex_t *a_mutex)
|
|||
if (__isthreaded)
|
||||
_SPINUNLOCK(&a_mutex->lock);
|
||||
}
|
||||
#endif /* __NetBSD__ */
|
||||
#endif /* __minix */
|
||||
|
||||
/*
|
||||
* End mutex.
|
||||
|
|
@ -3952,7 +3952,7 @@ free(void *ptr)
|
|||
/*
|
||||
* Begin non-standard functions.
|
||||
*/
|
||||
#ifndef __NetBSD__
|
||||
#ifndef __minix
|
||||
size_t
|
||||
malloc_usable_size(const void *ptr)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ void utrace(struct ut *, int);
|
|||
#endif /* defined(__minix) */
|
||||
|
||||
#include <sys/types.h>
|
||||
#if defined(__NetBSD__)
|
||||
#ifdef __minix /* MINIX-specific tracing and locking */
|
||||
#define malloc_minsize 16U
|
||||
#define HAS_UTRACE
|
||||
#define UTRACE_LABEL "malloc",
|
||||
|
|
@ -118,9 +118,13 @@ int utrace(const char *, void *, size_t);
|
|||
#include <reentrant.h>
|
||||
extern int __isthreaded;
|
||||
static mutex_t thread_lock = MUTEX_INITIALIZER;
|
||||
#define _MALLOC_LOCK() if (__isthreaded) mutex_lock(&thread_lock);
|
||||
#define _MALLOC_UNLOCK() if (__isthreaded) mutex_unlock(&thread_lock);
|
||||
#endif /* __NetBSD__ */
|
||||
#define _MALLOC_LOCK() \
|
||||
if (__isthreaded) \
|
||||
mutex_lock(&thread_lock);
|
||||
#define _MALLOC_UNLOCK() \
|
||||
if (__isthreaded) \
|
||||
mutex_unlock(&thread_lock);
|
||||
#endif /* __minix */
|
||||
|
||||
#if defined(__sparc__) && defined(sun)
|
||||
#define malloc_minsize 16U
|
||||
|
|
|
|||
|
|
@ -36,10 +36,10 @@ __RCSID("$NetBSD: strfmon.c,v 1.10 2012/03/21 14:19:15 christos Exp $");
|
|||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#if defined(__NetBSD__) || defined(__minix)
|
||||
#ifdef __minix /* MINIX uses namespace wrappers */
|
||||
#include "namespace.h"
|
||||
#include <monetary.h>
|
||||
#endif
|
||||
#endif /* __minix */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <assert.h>
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@
|
|||
** Nested includes
|
||||
*/
|
||||
|
||||
#if !defined(__NetBSD__) && !defined(__minix)
|
||||
#ifndef __minix
|
||||
/* Avoid clashes with NetBSD by renaming NetBSD's declarations. */
|
||||
#define localtime_rz sys_localtime_rz
|
||||
#define mktime_z sys_mktime_z
|
||||
|
|
@ -406,7 +406,7 @@ void tzset(void);
|
|||
extern char * asctime_r(struct tm const *restrict, char *restrict);
|
||||
#endif
|
||||
|
||||
#if defined(USG_COMPAT) && !defined(__NetBSD__) && !defined(__minix)
|
||||
#if defined(USG_COMPAT) && !defined(__minix)
|
||||
# ifndef timezone
|
||||
extern long timezone;
|
||||
# endif
|
||||
|
|
@ -449,9 +449,8 @@ time_t posix2time(time_t);
|
|||
|
||||
/* Infer TM_ZONE on systems where this information is known, but suppress
|
||||
guessing if NO_TM_ZONE is defined. Similarly for TM_GMTOFF. */
|
||||
#if (defined __GLIBC__ \
|
||||
|| defined __FreeBSD__ || defined __minix || defined __NetBSD__ || defined __OpenBSD__ \
|
||||
|| (defined __APPLE__ && defined __MACH__))
|
||||
#if (defined __GLIBC__ || defined __FreeBSD__ || defined __minix || \
|
||||
defined __OpenBSD__ || (defined __APPLE__ && defined __MACH__))
|
||||
# if !defined TM_GMTOFF && !defined NO_TM_GMTOFF
|
||||
# define TM_GMTOFF tm_gmtoff
|
||||
# endif
|
||||
|
|
@ -468,7 +467,7 @@ time_t posix2time(time_t);
|
|||
** is not done here. What we call 'struct state' NetBSD calls
|
||||
** 'struct __state', but this is a private name so it doesn't matter.
|
||||
*/
|
||||
#if !defined(__NetBSD__) && !defined(__minix)
|
||||
#ifndef __minix
|
||||
#if NETBSD_INSPIRED
|
||||
typedef struct state *timezone_t;
|
||||
struct tm *localtime_rz(timezone_t restrict, time_t const *restrict,
|
||||
|
|
|
|||
|
|
@ -98,9 +98,8 @@ typedef long intmax_t;
|
|||
|
||||
/* Infer TM_ZONE on systems where this information is known, but suppress
|
||||
guessing if NO_TM_ZONE is defined. Similarly for TM_GMTOFF. */
|
||||
#if (defined __GLIBC__ \
|
||||
|| defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ \
|
||||
|| (defined __APPLE__ && defined __MACH__))
|
||||
#if (defined __GLIBC__ || defined __FreeBSD__ || defined __minix || \
|
||||
defined __OpenBSD__ || (defined __APPLE__ && defined __MACH__))
|
||||
# if !defined TM_GMTOFF && !defined NO_TM_GMTOFF
|
||||
# define TM_GMTOFF tm_gmtoff
|
||||
# endif
|
||||
|
|
|
|||
|
|
@ -45,7 +45,8 @@
|
|||
* seems to actually advertise this properly, despite Unicode 3.1 having
|
||||
* been around since 2001... */
|
||||
#if !defined(__minix)
|
||||
#if !defined(__NetBSD__) && !defined(__sun) && !(defined(__APPLE__) && defined(__MACH__)) && !defined(__OpenBSD__) && !defined(__FreeBSD__)
|
||||
#if !defined(__sun) && !(defined(__APPLE__) && defined(__MACH__)) && \
|
||||
!defined(__OpenBSD__) && !defined(__FreeBSD__)
|
||||
#ifndef __STDC_ISO_10646__
|
||||
/* In many places it is assumed that the first 127 code points are ASCII
|
||||
* compatible, so ensure wchar_t indeed does ISO 10646 and not some other
|
||||
|
|
|
|||
|
|
@ -240,8 +240,17 @@ static Shell shells[] = {
|
|||
*/
|
||||
{
|
||||
DEFSHELL_CUSTOM,
|
||||
FALSE, "", "", "", 0,
|
||||
FALSE, "echo \"%s\"\n", "%s\n", "{ %s \n} || exit $?\n", "'\n'", '#',
|
||||
FALSE,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
0,
|
||||
FALSE,
|
||||
"echo \"%s\"\n",
|
||||
"%s\n",
|
||||
"{ %s \n} || exit $?\n",
|
||||
"'\n'",
|
||||
'#',
|
||||
"",
|
||||
"",
|
||||
},
|
||||
|
|
@ -252,9 +261,18 @@ static Shell shells[] = {
|
|||
*/
|
||||
{
|
||||
"sh",
|
||||
FALSE, "", "", "", 0,
|
||||
FALSE, "echo \"%s\"\n", "%s\n", "{ %s \n} || exit $?\n", "'\n'", '#',
|
||||
#if defined(MAKE_NATIVE) && defined(__NetBSD__)
|
||||
FALSE,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
0,
|
||||
FALSE,
|
||||
"echo \"%s\"\n",
|
||||
"%s\n",
|
||||
"{ %s \n} || exit $?\n",
|
||||
"'\n'",
|
||||
'#',
|
||||
#if defined(MAKE_NATIVE) && defined(__minix)
|
||||
"q",
|
||||
#else
|
||||
"",
|
||||
|
|
@ -266,8 +284,17 @@ static Shell shells[] = {
|
|||
*/
|
||||
{
|
||||
"ksh",
|
||||
TRUE, "set +v", "set -v", "set +v", 6,
|
||||
FALSE, "echo \"%s\"\n", "%s\n", "{ %s \n} || exit $?\n", "'\n'", '#',
|
||||
TRUE,
|
||||
"set +v",
|
||||
"set -v",
|
||||
"set +v",
|
||||
6,
|
||||
FALSE,
|
||||
"echo \"%s\"\n",
|
||||
"%s\n",
|
||||
"{ %s \n} || exit $?\n",
|
||||
"'\n'",
|
||||
'#',
|
||||
"v",
|
||||
"",
|
||||
},
|
||||
|
|
@ -278,20 +305,39 @@ static Shell shells[] = {
|
|||
*/
|
||||
{
|
||||
"csh",
|
||||
TRUE, "unset verbose", "set verbose", "unset verbose", 10,
|
||||
FALSE, "echo \"%s\"\n", "csh -c \"%s || exit 0\"\n", "", "'\\\n'", '#',
|
||||
"v", "e",
|
||||
TRUE,
|
||||
"unset verbose",
|
||||
"set verbose",
|
||||
"unset verbose",
|
||||
10,
|
||||
FALSE,
|
||||
"echo \"%s\"\n",
|
||||
"csh -c \"%s || exit 0\"\n",
|
||||
"",
|
||||
"'\\\n'",
|
||||
'#',
|
||||
"v",
|
||||
"e",
|
||||
},
|
||||
/*
|
||||
* UNKNOWN.
|
||||
*/
|
||||
{
|
||||
NULL,
|
||||
FALSE, NULL, NULL, NULL, 0,
|
||||
FALSE, NULL, NULL, NULL, NULL, 0,
|
||||
NULL, NULL,
|
||||
}
|
||||
};
|
||||
FALSE,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
0,
|
||||
FALSE,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
}};
|
||||
static Shell *commandShell = &shells[DEFSHELL_INDEX]; /* this is the shell to
|
||||
* which we pass all
|
||||
* commands in the Makefile.
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ void usage(void)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
#if HAVE_NBTOOL_CONFIG_H && !defined(__NetBSD__)
|
||||
#if HAVE_NBTOOL_CONFIG_H && defined(__minix)
|
||||
#define arc4random() rand()
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
#ifdef __NetBSD__
|
||||
#ifdef __minix
|
||||
__RCSID("$NetBSD: fast_ipsec.c,v 1.20 2013/04/15 21:20:39 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint*/
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "from: @(#)inet.c 8.4 (Berkeley) 4/20/94";
|
||||
#else
|
||||
#ifdef __NetBSD__
|
||||
#ifdef __minix
|
||||
__RCSID("$NetBSD: pfkey.c,v 1.1 2012/01/06 14:21:16 drochner Exp $");
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <syslog.h>
|
||||
#if defined(__NetBSD__) || defined(__minix)
|
||||
#if defined(__minix)
|
||||
#include <util.h>
|
||||
#endif
|
||||
#include <poll.h>
|
||||
|
|
@ -255,7 +255,7 @@ main(int argc, char *argv[])
|
|||
|
||||
sock_open();
|
||||
|
||||
#if defined(__NetBSD__) || defined(__minix)
|
||||
#if defined(__minix)
|
||||
/* record the current PID */
|
||||
if (pidfile(NULL) < 0) {
|
||||
syslog(LOG_ERR,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user