simplify Solaris CPP test
This commit is contained in:
parent
4ed41c209c
commit
1888f89375
|
@ -43,7 +43,7 @@
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
#include <libintl.h>
|
#include <libintl.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#if defined(sun) || defined(__sun)
|
#ifdef __sun
|
||||||
// XXX really needed, even on Solaris?
|
// XXX really needed, even on Solaris?
|
||||||
#include <stropts.h>
|
#include <stropts.h>
|
||||||
#else
|
#else
|
||||||
|
|
10
bin/main.cc
10
bin/main.cc
|
@ -50,7 +50,7 @@
|
||||||
#include <fcntl.h> /* open() */
|
#include <fcntl.h> /* open() */
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#if defined(sun) || defined(__sun)
|
#ifdef __sun
|
||||||
# include <sys/systeminfo.h> /* sysinfo() */
|
# include <sys/systeminfo.h> /* sysinfo() */
|
||||||
#else
|
#else
|
||||||
#include <sys/sysinfo.h>
|
#include <sys/sysinfo.h>
|
||||||
|
@ -206,7 +206,7 @@ main(int argc, char *argv[])
|
||||||
|
|
||||||
struct stat out_stat, err_stat;
|
struct stat out_stat, err_stat;
|
||||||
hostid = gethostid();
|
hostid = gethostid();
|
||||||
#if defined(sun) || defined(__sun)
|
#ifdef __sun
|
||||||
bsd_signals();
|
bsd_signals();
|
||||||
#else
|
#else
|
||||||
// XXX necessary on linux?
|
// XXX necessary on linux?
|
||||||
|
@ -488,7 +488,7 @@ main(int argc, char *argv[])
|
||||||
/*
|
/*
|
||||||
* Enable interrupt handler for alarms
|
* Enable interrupt handler for alarms
|
||||||
*/
|
*/
|
||||||
#if defined(sun) || defined(__sun)
|
#ifdef __sun
|
||||||
(void) bsd_signal(SIGALRM, (SIG_PF)doalarm);
|
(void) bsd_signal(SIGALRM, (SIG_PF)doalarm);
|
||||||
#else
|
#else
|
||||||
(void) bsd_signal(SIGALRM, doalarm);
|
(void) bsd_signal(SIGALRM, doalarm);
|
||||||
|
@ -926,7 +926,7 @@ read_command_options(register int argc, register char **argv)
|
||||||
// between Solaris and GNU libc.
|
// between Solaris and GNU libc.
|
||||||
// Also, the '+' is probably a good idea for GNU libc to avoid
|
// Also, the '+' is probably a good idea for GNU libc to avoid
|
||||||
// reording of arguments.
|
// reording of arguments.
|
||||||
#if defined(sun) || defined(__sun)
|
#ifdef __sun
|
||||||
#define SUNPRO_CMD_OPTS "-~Bbc:Ddef:g:ij:K:kM:m:NnO:o:PpqRrSsTtuVvwx:"
|
#define SUNPRO_CMD_OPTS "-~Bbc:Ddef:g:ij:K:kM:m:NnO:o:PpqRrSsTtuVvwx:"
|
||||||
#define SVR4_CMD_OPTS "-c:ef:g:ij:km:nO:o:pqrsTtVv"
|
#define SVR4_CMD_OPTS "-c:ef:g:ij:km:nO:o:pqrsTtVv"
|
||||||
#else
|
#else
|
||||||
|
@ -1623,7 +1623,7 @@ make_install_prefix(void)
|
||||||
char *dir;
|
char *dir;
|
||||||
|
|
||||||
if ((ret = readlink(
|
if ((ret = readlink(
|
||||||
#if defined(sun) || defined(__sun)
|
#ifdef __sun
|
||||||
"/proc/self/path/a.out",
|
"/proc/self/path/a.out",
|
||||||
#else
|
#else
|
||||||
"/proc/self/exe",
|
"/proc/self/exe",
|
||||||
|
|
|
@ -255,7 +255,7 @@ execute_parallel(Property line, Boolean waitflg, Boolean local)
|
||||||
#include <sys/ipc.h> /* ftok() */
|
#include <sys/ipc.h> /* ftok() */
|
||||||
#include <sys/shm.h> /* shmget(), shmat(), shmdt(), shmctl() */
|
#include <sys/shm.h> /* shmget(), shmat(), shmdt(), shmctl() */
|
||||||
#include <semaphore.h> /* sem_init(), sem_trywait(), sem_post(), sem_destroy() */
|
#include <semaphore.h> /* sem_init(), sem_trywait(), sem_post(), sem_destroy() */
|
||||||
#if defined(sun) || defined(__sun)
|
#ifdef __sun
|
||||||
#include <sys/loadavg.h> /* getloadavg() */
|
#include <sys/loadavg.h> /* getloadavg() */
|
||||||
#else
|
#else
|
||||||
#include <stdlib.h> // getloadavg()
|
#include <stdlib.h> // getloadavg()
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
#include <errno.h> /* errno */
|
#include <errno.h> /* errno */
|
||||||
#include <locale.h> /* MB_CUR_MAX */
|
#include <locale.h> /* MB_CUR_MAX */
|
||||||
|
|
||||||
#if defined(sun) || defined(__sun)
|
#ifdef __sun
|
||||||
#else
|
#else
|
||||||
#include <libintl.h> // gettext()
|
#include <libintl.h> // gettext()
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#ifndef COMP_NAMELEN_H
|
#ifndef COMP_NAMELEN_H
|
||||||
#define COMP_NAMELEN_H
|
#define COMP_NAMELEN_H
|
||||||
|
|
||||||
#if defined(sun) || defined(__sun)
|
#ifdef __sun
|
||||||
#else
|
#else
|
||||||
#define MAXNAMELEN 1024
|
#define MAXNAMELEN 1024
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#ifndef COMP_TIMESTRUC_T_H
|
#ifndef COMP_TIMESTRUC_T_H
|
||||||
#define COMP_TIMESTRUC_T_H
|
#define COMP_TIMESTRUC_T_H
|
||||||
|
|
||||||
#if defined(sun) || defined(__sun)
|
#ifdef __sun
|
||||||
#else
|
#else
|
||||||
typedef struct timespec timestruc_t;
|
typedef struct timespec timestruc_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#if defined(sun) || defined(__sun)
|
#ifdef __sun
|
||||||
|
|
||||||
#ifndef __cplusplus
|
#ifndef __cplusplus
|
||||||
typedef void (*SIG_PF) (int);
|
typedef void (*SIG_PF) (int);
|
||||||
|
|
|
@ -294,7 +294,7 @@ extern long int hostid;
|
||||||
* Declarations of system defined variables
|
* Declarations of system defined variables
|
||||||
*/
|
*/
|
||||||
/* On linux this variable is defined in 'signal.h' */
|
/* On linux this variable is defined in 'signal.h' */
|
||||||
#if defined(sun) || defined(__sun)
|
#ifdef __sun
|
||||||
extern char *sys_siglist[];
|
extern char *sys_siglist[];
|
||||||
#else
|
#else
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
@ -357,7 +357,7 @@ extern wchar_t *getmem_wc(register int size);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
#if defined(sun) || defined(__sun)
|
#ifdef __sun
|
||||||
extern char *getwd(char *);
|
extern char *getwd(char *);
|
||||||
#endif
|
#endif
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -93,7 +93,7 @@ redirect_io(char *stdout_file, char *stderr_file)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
#if defined(sun) || defined(__sun)
|
#ifdef __sun
|
||||||
(void) closefrom(3);
|
(void) closefrom(3);
|
||||||
#else
|
#else
|
||||||
// XXX not available on Linux
|
// XXX not available on Linux
|
||||||
|
|
|
@ -272,28 +272,28 @@ void
|
||||||
enable_interrupt(register void (*handler) (int))
|
enable_interrupt(register void (*handler) (int))
|
||||||
{
|
{
|
||||||
if (sigivalue != SIG_IGN) {
|
if (sigivalue != SIG_IGN) {
|
||||||
#if defined(sun) || defined(__sun)
|
#ifdef __sun
|
||||||
(void) bsd_signal(SIGINT, (SIG_PF) handler);
|
(void) bsd_signal(SIGINT, (SIG_PF) handler);
|
||||||
#else
|
#else
|
||||||
(void) bsd_signal(SIGINT, handler);
|
(void) bsd_signal(SIGINT, handler);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (sigqvalue != SIG_IGN) {
|
if (sigqvalue != SIG_IGN) {
|
||||||
#if defined(sun) || defined(__sun)
|
#ifdef __sun
|
||||||
(void) bsd_signal(SIGQUIT, (SIG_PF) handler);
|
(void) bsd_signal(SIGQUIT, (SIG_PF) handler);
|
||||||
#else
|
#else
|
||||||
(void) bsd_signal(SIGQUIT, handler);
|
(void) bsd_signal(SIGQUIT, handler);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (sigtvalue != SIG_IGN) {
|
if (sigtvalue != SIG_IGN) {
|
||||||
#if defined(sun) || defined(__sun)
|
#ifdef __sun
|
||||||
(void) bsd_signal(SIGTERM, (SIG_PF) handler);
|
(void) bsd_signal(SIGTERM, (SIG_PF) handler);
|
||||||
#else
|
#else
|
||||||
(void) bsd_signal(SIGTERM, handler);
|
(void) bsd_signal(SIGTERM, handler);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (sighvalue != SIG_IGN) {
|
if (sighvalue != SIG_IGN) {
|
||||||
#if defined(sun) || defined(__sun)
|
#ifdef __sun
|
||||||
(void) bsd_signal(SIGHUP, (SIG_PF) handler);
|
(void) bsd_signal(SIGHUP, (SIG_PF) handler);
|
||||||
#else
|
#else
|
||||||
(void) bsd_signal(SIGHUP, handler);
|
(void) bsd_signal(SIGHUP, handler);
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
#include <errno.h> /* errno */
|
#include <errno.h> /* errno */
|
||||||
#include <libintl.h>
|
#include <libintl.h>
|
||||||
|
|
||||||
#if defined(sun) || defined(__sun)
|
#ifdef __sun
|
||||||
extern char *sys_errlist[];
|
extern char *sys_errlist[];
|
||||||
extern int sys_nerr;
|
extern int sys_nerr;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue