simplify Solaris CPP test

This commit is contained in:
Georg Sauthoff 2016-08-23 20:26:31 +02:00
parent 4ed41c209c
commit 1888f89375
11 changed files with 19 additions and 19 deletions

View file

@ -43,7 +43,7 @@
#include <poll.h>
#include <libintl.h>
#include <signal.h>
#if defined(sun) || defined(__sun)
#ifdef __sun
// XXX really needed, even on Solaris?
#include <stropts.h>
#else

View file

@ -50,7 +50,7 @@
#include <fcntl.h> /* open() */
#include <ctype.h>
#if defined(sun) || defined(__sun)
#ifdef __sun
# include <sys/systeminfo.h> /* sysinfo() */
#else
#include <sys/sysinfo.h>
@ -206,7 +206,7 @@ main(int argc, char *argv[])
struct stat out_stat, err_stat;
hostid = gethostid();
#if defined(sun) || defined(__sun)
#ifdef __sun
bsd_signals();
#else
// XXX necessary on linux?
@ -488,7 +488,7 @@ main(int argc, char *argv[])
/*
* Enable interrupt handler for alarms
*/
#if defined(sun) || defined(__sun)
#ifdef __sun
(void) bsd_signal(SIGALRM, (SIG_PF)doalarm);
#else
(void) bsd_signal(SIGALRM, doalarm);
@ -926,7 +926,7 @@ read_command_options(register int argc, register char **argv)
// between Solaris and GNU libc.
// Also, the '+' is probably a good idea for GNU libc to avoid
// 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 SVR4_CMD_OPTS "-c:ef:g:ij:km:nO:o:pqrsTtVv"
#else
@ -1623,7 +1623,7 @@ make_install_prefix(void)
char *dir;
if ((ret = readlink(
#if defined(sun) || defined(__sun)
#ifdef __sun
"/proc/self/path/a.out",
#else
"/proc/self/exe",

View file

@ -255,7 +255,7 @@ execute_parallel(Property line, Boolean waitflg, Boolean local)
#include <sys/ipc.h> /* ftok() */
#include <sys/shm.h> /* shmget(), shmat(), shmdt(), shmctl() */
#include <semaphore.h> /* sem_init(), sem_trywait(), sem_post(), sem_destroy() */
#if defined(sun) || defined(__sun)
#ifdef __sun
#include <sys/loadavg.h> /* getloadavg() */
#else
#include <stdlib.h> // getloadavg()

View file

@ -39,7 +39,7 @@
#include <errno.h> /* errno */
#include <locale.h> /* MB_CUR_MAX */
#if defined(sun) || defined(__sun)
#ifdef __sun
#else
#include <libintl.h> // gettext()
#endif

View file

@ -2,7 +2,7 @@
#ifndef COMP_NAMELEN_H
#define COMP_NAMELEN_H
#if defined(sun) || defined(__sun)
#ifdef __sun
#else
#define MAXNAMELEN 1024
#endif

View file

@ -2,7 +2,7 @@
#ifndef COMP_TIMESTRUC_T_H
#define COMP_TIMESTRUC_T_H
#if defined(sun) || defined(__sun)
#ifdef __sun
#else
typedef struct timespec timestruc_t;
#endif

View file

@ -32,7 +32,7 @@
#include <signal.h>
#if defined(sun) || defined(__sun)
#ifdef __sun
#ifndef __cplusplus
typedef void (*SIG_PF) (int);

View file

@ -294,7 +294,7 @@ extern long int hostid;
* Declarations of system defined variables
*/
/* On linux this variable is defined in 'signal.h' */
#if defined(sun) || defined(__sun)
#ifdef __sun
extern char *sys_siglist[];
#else
#include <signal.h>
@ -357,7 +357,7 @@ extern wchar_t *getmem_wc(register int size);
#ifdef __cplusplus
extern "C" {
#endif
#if defined(sun) || defined(__sun)
#ifdef __sun
extern char *getwd(char *);
#endif
#ifdef __cplusplus

View file

@ -93,7 +93,7 @@ redirect_io(char *stdout_file, char *stderr_file)
{
int i;
#if defined(sun) || defined(__sun)
#ifdef __sun
(void) closefrom(3);
#else
// XXX not available on Linux

View file

@ -272,28 +272,28 @@ void
enable_interrupt(register void (*handler) (int))
{
if (sigivalue != SIG_IGN) {
#if defined(sun) || defined(__sun)
#ifdef __sun
(void) bsd_signal(SIGINT, (SIG_PF) handler);
#else
(void) bsd_signal(SIGINT, handler);
#endif
}
if (sigqvalue != SIG_IGN) {
#if defined(sun) || defined(__sun)
#ifdef __sun
(void) bsd_signal(SIGQUIT, (SIG_PF) handler);
#else
(void) bsd_signal(SIGQUIT, handler);
#endif
}
if (sigtvalue != SIG_IGN) {
#if defined(sun) || defined(__sun)
#ifdef __sun
(void) bsd_signal(SIGTERM, (SIG_PF) handler);
#else
(void) bsd_signal(SIGTERM, handler);
#endif
}
if (sighvalue != SIG_IGN) {
#if defined(sun) || defined(__sun)
#ifdef __sun
(void) bsd_signal(SIGHUP, (SIG_PF) handler);
#else
(void) bsd_signal(SIGHUP, handler);

View file

@ -36,7 +36,7 @@
#include <errno.h> /* errno */
#include <libintl.h>
#if defined(sun) || defined(__sun)
#ifdef __sun
extern char *sys_errlist[];
extern int sys_nerr;
#endif