Protect all BSD extensions with _BSD_SOURCE
* Do not define the symbols by default, as they are not in the default libraries. * Adjust jamfiles of all code using BSD extensions to define _BSD_SOURCE. * This makes Haiku slightly more compliant to standard C/POSIX.
This commit is contained in:
@@ -36,6 +36,10 @@
|
||||
#ifndef _ARPA_FTP_H_
|
||||
#define _ARPA_FTP_H_
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
/* Definitions for FTP; see RFC-765. */
|
||||
|
||||
/*
|
||||
@@ -106,4 +110,8 @@ char *modenames[] = {"0", "Stream", "Block", "Compressed" };
|
||||
|
||||
#define BLK_BYTECOUNT 2 /* Bytes in this block */
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* !_FTP_H_ */
|
||||
|
||||
@@ -37,6 +37,10 @@
|
||||
#ifndef _ARPA_TELNET_H_
|
||||
#define _ARPA_TELNET_H_
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
/*
|
||||
* Definitions for the TELNET protocol.
|
||||
*/
|
||||
@@ -344,4 +348,8 @@ extern char *enctype_names[];
|
||||
#define ENCTYPE_NAME_OK(x) ((unsigned int)(x) < ENCTYPE_CNT)
|
||||
#define ENCTYPE_NAME(x) enctype_names[x]
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* !_TELNET_H_ */
|
||||
|
||||
@@ -37,6 +37,10 @@
|
||||
#ifndef _ARPA_TFTP_H_
|
||||
#define _ARPA_TFTP_H_
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
/*
|
||||
* Trivial File Transfer Protocol (IEN-133)
|
||||
*/
|
||||
@@ -80,4 +84,8 @@ struct tftphdr {
|
||||
#define ENOUSER 7 /* no such user */
|
||||
#define EOPTNEG 8 /* option negotiation failed */
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* !_TFTP_H_ */
|
||||
|
||||
@@ -37,6 +37,10 @@
|
||||
#ifndef _ERR_H_
|
||||
#define _ERR_H_
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
/*
|
||||
* Don't use va_list in the err/warn prototypes. Va_list is typedef'd in two
|
||||
* places (<machine/varargs.h> and <machine/stdarg.h>), so if we include one
|
||||
@@ -69,4 +73,8 @@ void err_set_file(void *);
|
||||
void err_set_exit(void (*)(int));
|
||||
__END_DECLS
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* !_ERR_H_ */
|
||||
|
||||
@@ -9,6 +9,13 @@
|
||||
#include_next <errno.h>
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
#define EDOOFUS EINVAL
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _BSD_ERRNO_H_ */
|
||||
|
||||
@@ -40,6 +40,10 @@
|
||||
#ifndef _HISTEDIT_H_
|
||||
#define _HISTEDIT_H_
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
@@ -225,4 +229,8 @@ int tok_str(Tokenizer *, const char *,
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _HISTEDIT_H_ */
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
#define _IFADDRS_H
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -32,4 +35,7 @@ void freeifaddrs(struct ifaddrs *ifa);
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -39,6 +39,10 @@
|
||||
#ifndef _LIBUTIL_H_
|
||||
#define _LIBUTIL_H_
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
@@ -162,4 +166,8 @@ __END_DECLS
|
||||
#define HN_GETSCALE 0x10
|
||||
#define HN_AUTOSCALE 0x20
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* !_LIBUTIL_H_ */
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
#define _NETINET_IN_SYSTM_H_
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
@@ -14,4 +17,7 @@ typedef uint32_t n_long;
|
||||
typedef uint32_t n_time;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _NETINET_IN_SYSTM_H_ */
|
||||
|
||||
@@ -37,6 +37,10 @@
|
||||
#ifndef _PATHS_H_
|
||||
#define _PATHS_H_
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
/* Default search path. */
|
||||
@@ -136,4 +140,8 @@ __END_DECLS
|
||||
#define _PATH_WALL "/rescue/wall"
|
||||
#endif /* RESCUE */
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* !_PATHS_H_ */
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
#define _BSD_PTY_H_
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <termios.h>
|
||||
|
||||
@@ -20,4 +23,8 @@ extern pid_t forkpty(int* master, char* name,
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif // _BSD_PTY_H_
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
#include_next <signal.h>
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
#define sigmask(sig) (1 << ((sig) - 1))
|
||||
|
||||
|
||||
@@ -23,4 +26,8 @@ int sigblock(int mask);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _BSD_SIGNAL_H_ */
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
#include_next <stdio.h>
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -19,4 +22,8 @@ char *fgetln(FILE *stream, size_t *_length);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _BSD_STDIO_H_ */
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
#include_next <stdlib.h>
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -21,4 +24,8 @@ void setprogname(const char *programName);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _BSD_STDLIB_H_ */
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
#include_next <string.h>
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -19,4 +22,8 @@ char* strsep(char** string, const char* delimiters);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _BSD_STRING_H_ */
|
||||
|
||||
@@ -35,6 +35,11 @@
|
||||
|
||||
#ifndef _STRINGLIST_H
|
||||
#define _STRINGLIST_H
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -54,4 +59,8 @@ void sl_free(StringList *, int);
|
||||
char *sl_find(StringList *, char *);
|
||||
__END_DECLS
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _STRINGLIST_H */
|
||||
|
||||
@@ -9,10 +9,17 @@
|
||||
#include_next <sys/cdefs.h>
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
#define __FBSDID(x)
|
||||
#define __unused
|
||||
|
||||
#define __printflike(a, b) __attribute__ ((format (__printf__, (a), (b))))
|
||||
#define __printf0like(a, b)
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _BSD_SYS_CDEFS_H_ */
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
#ifndef _SYS_IOCCOM_H
|
||||
#define _SYS_IOCCOM_H
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
/**
|
||||
* @defgroup IOCTL_common sys/ioccom.h
|
||||
* @brief Definitions & maros common to ioctl()
|
||||
@@ -77,4 +81,8 @@
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _SYS_IOCCOM_H */
|
||||
|
||||
@@ -26,6 +26,11 @@
|
||||
|
||||
#ifndef _MD4_H_
|
||||
#define _MD4_H_
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
/* MD4 context. */
|
||||
typedef struct MD4Context {
|
||||
u_int32_t state[4]; /* state (ABCD) */
|
||||
@@ -45,4 +50,8 @@ char * MD4File(const char *, char *);
|
||||
char * MD4Data(const unsigned char *, unsigned int, char *);
|
||||
__END_DECLS
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _MD4_H_ */
|
||||
|
||||
@@ -28,6 +28,10 @@ documentation and/or software.
|
||||
#ifndef _SYS_MD5_H_
|
||||
#define _SYS_MD5_H_
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define MD5_BLOCK_LENGTH 64
|
||||
@@ -52,4 +56,9 @@ char * MD5File(const char *, char *);
|
||||
char * MD5FileChunk(const char *, char *, off_t, off_t);
|
||||
char * MD5Data(const unsigned char *, unsigned int, char *);
|
||||
__END_DECLS
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _SYS_MD5_H_ */
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
#include_next <sys/param.h>
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
#ifndef _ALIGNBYTES
|
||||
# define _ALIGNBYTES 7
|
||||
#endif
|
||||
@@ -31,4 +34,8 @@
|
||||
# define MAXLOGNAME 32
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _BSD_SYS_PARAM_H_ */
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
|
||||
#include_next <sys/wait.h>
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
#include <sys/resource.h>
|
||||
|
||||
|
||||
@@ -23,4 +27,8 @@ pid_t wait4(pid_t pid, int *status, int options, struct rusage *rusage);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _BSD_SYS_WAIT_H_ */
|
||||
|
||||
@@ -34,6 +34,10 @@
|
||||
#ifndef _SYSEXITS_H_
|
||||
#define _SYSEXITS_H_
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
/*
|
||||
* SYSEXITS.H -- Exit status codes for system programs.
|
||||
*
|
||||
@@ -113,4 +117,8 @@
|
||||
|
||||
#define EX__MAX 78 /* maximum listed value */
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* !_SYSEXITS_H_ */
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
#include_next <time.h>
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -20,4 +23,8 @@ time_t timegm(struct tm *tm);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _BSD_TIME_H_ */
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
#include_next <unistd.h>
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
#define L_SET SEEK_SET
|
||||
#define L_INCR SEEK_CUR
|
||||
#define L_XTND SEEK_END
|
||||
@@ -28,4 +31,8 @@ void setusershell(void);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _BSD_UNISTD_H_ */
|
||||
|
||||
@@ -38,6 +38,9 @@
|
||||
#define _VIS_H_
|
||||
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
|
||||
@@ -89,4 +92,8 @@ int strunvisx(char *, const char *, int);
|
||||
int unvis(char *, int, int *, int);
|
||||
__END_DECLS
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* !_VIS_H_ */
|
||||
|
||||
Reference in New Issue
Block a user