diff --git a/cde/configure.ac b/cde/configure.ac index 32d1ff0a8..d11392d03 100644 --- a/cde/configure.ac +++ b/cde/configure.ac @@ -63,15 +63,6 @@ build_netbsd=no build_solaris=no build_aix=no -dnl For now, we need to fake the OSMAJORVERSION, OSMINORVERSION. In Linux -dnl this never mattered anyway as it was always the kernel version. We will -dnl choose defaults here. These need to be removed in the code in favor -dnl of actual checks for functionality. So this should be considered -dnl temporary. - -OSMAJORVERSION=4 -OSMINORVERSION=15 - dnl locations of libs/includes if not in 'standard' places like on dnl linux (/usr/...). We build these up based on where X11 is, and dnl other things as we go along. @@ -84,8 +75,6 @@ supports_pam=no case "${build_os}" in linux*) build_linux=yes - OSMAJORVERSION=4 - OSMINORVERSION=15 SOURCE_CPP_DEFINES="${SOURCE_CPP_DEFINES} -D_POSIX_SOURCE \ -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE" supports_pam=yes @@ -93,8 +82,6 @@ case "${build_os}" in freebsd*) build_freebsd=yes bsd=yes - OSMAJORVERSION=10 - OSMINORVERSION=0 # fbsd needs the iconv plug to avoid conflict with libiconv # and libc implementations. We prefer the libc impl. SOURCE_CPP_DEFINES="${SOURCE_CPP_DEFINES} -DLIBICONV_PLUG" @@ -102,20 +89,14 @@ case "${build_os}" in openbsd*) build_openbsd=yes bsd=yes - OSMAJORVERSION=6 - OSMINORVERSION=2 ;; netbsd*) build_netbsd=yes bsd=yes - OSMAJORVERSION=8 - OSMINORVERSION=0 supports_pam=yes ;; solaris*|sun*) build_solaris=yes - OSMAJORVERSION=5 - OSMINORVERSION=10 ;; aix*) build_aix=yes @@ -130,9 +111,6 @@ AM_CONDITIONAL([NETBSD], [test "$build_netbsd" = "yes"]) AM_CONDITIONAL([SOLARIS], [test "$build_solaris" = "yes"]) AM_CONDITIONAL([AIX], [test "$build_aix" = "yes"]) -dnl Add osmajor/minor version to cppflags. -OSVERSION="-DOSMAJORVERSION=$OSMAJORVERSION -DOSMINORVERSION=$OSMINORVERSION" - dnl set CSRG_BASED define for the BSD's. if test "$bsd" = "yes" then @@ -547,7 +525,7 @@ dnl shouldn't be modified. It suggests that you create a special dnl variable and presumably add those to your Makefile.am files. We dnl have 192 of these currently, so... The user will just have to dnl deal, or modify them here directly. -CPPFLAGS="${CPPFLAGS} ${SOURCE_CPP_DEFINES} ${CPP_COMPILER_FLAGS} ${OSVERSION}" +CPPFLAGS="${CPPFLAGS} ${SOURCE_CPP_DEFINES} ${CPP_COMPILER_FLAGS}" CFLAGS="${CFLAGS} ${C_COMPILER_FLAGS} ${EXTRA_INCS} ${PTHREAD_CFLAGS}" CXXFLAGS="${CXXFLAGS} ${CXX_COMPILER_FLAGS} ${EXTRA_INCS} ${PTHREAD_CFLAGS}" LIBS="${EXTRA_LIBS} ${LIBS} ${PTHREAD_LIBS}" diff --git a/cde/lib/DtSvc/DtUtil2/XlationSvc.c b/cde/lib/DtSvc/DtUtil2/XlationSvc.c index c36f97dee..669586170 100644 --- a/cde/lib/DtSvc/DtUtil2/XlationSvc.c +++ b/cde/lib/DtSvc/DtUtil2/XlationSvc.c @@ -2245,8 +2245,10 @@ int _DtXlateGetXlateEnv( 809 = (int) (100.0 * atof("8.09")); ===========================*/ -#if !defined(OSMAJORVERSION) || !defined(OSMINORVERSION) || OSMAJORVERSION == 0 -#error OSMAJORVERSION and/or OSMINORVERSION not defined +#if !defined(OSMAJORVERSION) && !defined(OSMINORVERSION) +#warning "OSMAJORVERSION and OSMINORVERSION not defined, assuming 99.0: +#define OSMAJORVERSION 99 +#define OSMINORVERSION 0 #endif #if defined(__linux__) || defined(CSRG_BASED) diff --git a/cde/lib/DtSvc/Makefile.am b/cde/lib/DtSvc/Makefile.am index 273048f26..90aa72c73 100644 --- a/cde/lib/DtSvc/Makefile.am +++ b/cde/lib/DtSvc/Makefile.am @@ -19,6 +19,35 @@ if SOLARIS libDtSvc_la_CPPFLAGS += -DNO_REGCOMP endif +# OSVERSION hackery. This database works by comparing a number +# computed with the OS major/minor versions to determine appropriate +# entries in the Xlocale DB. These are currently hardcoded per OS in +# configure.ac. Well, no more. Now they will be hardcoded per OS +# here - the only place where they are really needed currently, until +# some time in the future when old and irrelevant entries are removed +# from the DB and we won't need this at all. + +if LINUX +libDtSvc_la_CPPFLAGS += -DOSMAJORVERSION=4 -DOSMINORVERSION=15 +endif + +if FREEBSD +libDtSvc_la_CPPFLAGS += -DOSMAJORVERSION=10 -DOSMINORVERSION=0 +endif + +if OPENBSD +libDtSvc_la_CPPFLAGS += -DOSMAJORVERSION=6 -DOSMINORVERSION=2 +endif + +if NETBSD +libDtSvc_la_CPPFLAGS += -DOSMAJORVERSION=8 -DOSMINORVERSION=0 +endif + +if SOLARIS +libDtSvc_la_CPPFLAGS += -DOSMAJORVERSION=5 -DOSMINORVERSION=10 +endif + + libDtSvc_la_SOURCES = DtCodelibs/buf.C \ DtCodelibs/buf.h \ DtCodelibs/filegen.C \ diff --git a/cde/lib/DtTerm/TermPrim/TermPrimSetUtmp.c b/cde/lib/DtTerm/TermPrim/TermPrimSetUtmp.c index 32e576c4c..df2574d17 100644 --- a/cde/lib/DtTerm/TermPrim/TermPrimSetUtmp.c +++ b/cde/lib/DtTerm/TermPrim/TermPrimSetUtmp.c @@ -55,9 +55,7 @@ #endif /* sun */ #ifdef __FreeBSD__ -#if OSMAJORVERSION > 8 #define UT_UTMPX -#endif #define UT_HOST ut_host #define UT_NO_pututline #endif diff --git a/cde/lib/tt/lib/mp/mp_stream_socket.C b/cde/lib/tt/lib/mp/mp_stream_socket.C index fbc3f5122..5009a99ef 100644 --- a/cde/lib/tt/lib/mp/mp_stream_socket.C +++ b/cde/lib/tt/lib/mp/mp_stream_socket.C @@ -209,12 +209,7 @@ init(int init_as_source) return(0); } len = sizeof(sockaddr_in); -#if defined(_AIX) && (OSMAJORVERSION==4) && (OSMINORVERSION==2) - if (getsockname(_sock, (sockaddr *)&_hostaddr, (size_t *)&len) - < 0) { -#else if (getsockname(_sock, (sockaddr *)&_hostaddr, &len) < 0) { -#endif return(0); } return(listen(_sock,5) == 0); @@ -440,13 +435,9 @@ accept() #endif sockaddr_in saddr; -#if defined(_AIX) && (OSMAJORVERSION==4) && (OSMINORVERSION==2) - _msgsock = ::accept(_sock, (struct sockaddr *)&saddr, - (size_t *)&addrlen); -#else _msgsock = ::accept(_sock, (struct sockaddr *)&saddr, &addrlen); -#endif + if (_msgsock < 0) { _tt_syslog( 0, LOG_ERR, "_Tt_stream_socket::accept(): " "accept(): %m" ); diff --git a/cde/lib/tt/slib/mp_rpc_server.C b/cde/lib/tt/slib/mp_rpc_server.C index 7924901a2..bf75c67a3 100644 --- a/cde/lib/tt/slib/mp_rpc_server.C +++ b/cde/lib/tt/slib/mp_rpc_server.C @@ -410,11 +410,7 @@ gettransient(int proto, int vers, int *sockp) _tt_syslog(0, LOG_ERR, "bind(): %m"); return(0); } -#if defined (_AIX) && (OSMAJORVERSION==4) && (OSMINORVERSION==2) - if (getsockname(s, (sockaddr *)&addr, (size_t *)&len) < 0) { -#else if (getsockname(s, (sockaddr *)&addr, &len) < 0) { -#endif _tt_syslog(0, LOG_ERR, "getsockname(): %m"); return(0); } diff --git a/cde/programs/dtappbuilder/src/libAButil/util.c b/cde/programs/dtappbuilder/src/libAButil/util.c index f4e4f12f3..7d49ee4da 100644 --- a/cde/programs/dtappbuilder/src/libAButil/util.c +++ b/cde/programs/dtappbuilder/src/libAButil/util.c @@ -230,17 +230,6 @@ util_vfork(void) /* * putenv() is non-POSIX, so the parameter types can vary a bit... */ -#ifdef __cplusplus -extern "C" { -#endif -#if (defined(sun) && OSMAJORVERSION >= 5 && OSMINORVERSION >= 4 && OSMINORVERSION <=10 ) - extern int putenv(const char *string); -#elif !(defined(__aix) || defined(__NetBSD__)) - extern int putenv(char *string); -#endif -#ifdef __cplusplus -} // extern "C" -#endif int util_putenv(STRING string) { diff --git a/cde/programs/dtlogin/account.c b/cde/programs/dtlogin/account.c index a9721c862..6014333e6 100644 --- a/cde/programs/dtlogin/account.c +++ b/cde/programs/dtlogin/account.c @@ -51,7 +51,7 @@ #endif #include -#if defined(__FreeBSD__) && OSMAJORVERSION > 8 || defined(HAS_PAM_LIBRARY) +#if defined (__FreeBSD__) || defined(HAS_PAM_LIBRARY) #include #else #include diff --git a/cde/programs/dtlogin/dm.c b/cde/programs/dtlogin/dm.c index b73b24e5d..45e228c3e 100644 --- a/cde/programs/dtlogin/dm.c +++ b/cde/programs/dtlogin/dm.c @@ -54,7 +54,7 @@ # include # include # include -#if defined(__FreeBSD__) && OSMAJORVERSION > 8 +#if defined(__FreeBSD__) # include #else # include @@ -1646,7 +1646,7 @@ GettyMessage( struct display *d, int msgnum ) int GettyRunning( struct display *d ) { -#if defined(__FreeBSD__) && OSMAJORVERSION > 8 +#if defined(__FreeBSD__) struct utmpx utmp; /* local struct for new entry */ struct utmpx *u; /* pointer to entry in utmp file */ #else @@ -1671,7 +1671,7 @@ GettyRunning( struct display *d ) return FALSE; -#if defined(__FreeBSD__) && OSMAJORVERSION > 8 +#if defined(__FreeBSD__) bzero(&utmp, sizeof(struct utmpx)); #else bzero(&utmp, sizeof(struct utmp)); diff --git a/cde/programs/dtlogin/fontpath.c b/cde/programs/dtlogin/fontpath.c index dbd7d876e..591c7fe6d 100644 --- a/cde/programs/dtlogin/fontpath.c +++ b/cde/programs/dtlogin/fontpath.c @@ -39,7 +39,7 @@ # include # include # include -#if defined(__FreeBSD__) && OSMAJORVERSION > 8 +#if defined(__FreeBSD__) # include #else # include diff --git a/cde/programs/dtlogin/genauth.c b/cde/programs/dtlogin/genauth.c index c9836bce9..be4b97929 100644 --- a/cde/programs/dtlogin/genauth.c +++ b/cde/programs/dtlogin/genauth.c @@ -112,10 +112,6 @@ extern int errno; # define DONT_USE_DES # elif defined(sun) # define USE_CRYPT -# if (OSMAJORVERSION >= 4) - /* avoid strange sun crypt hackery */ -# define crypt _crypt -# endif # endif # define USE_ENCRYPT #endif diff --git a/cde/programs/dtlogin/session.c b/cde/programs/dtlogin/session.c index 4e624a97e..c7bb5fb4b 100644 --- a/cde/programs/dtlogin/session.c +++ b/cde/programs/dtlogin/session.c @@ -67,7 +67,7 @@ # include # include # include -#if defined(__FreeBSD__) && OSMAJORVERSION > 8 || defined(HAS_PAM_LIBRARY) +#if defined(__FreeBSD__) || defined(HAS_PAM_LIBRARY) # include #else # include diff --git a/cde/programs/dtlogin/socket.c b/cde/programs/dtlogin/socket.c index d138b9512..4a3ee19f3 100644 --- a/cde/programs/dtlogin/socket.c +++ b/cde/programs/dtlogin/socket.c @@ -165,11 +165,7 @@ GetChooserAddr (char *addr, int *lenp) int len; len = sizeof in_addr; -#if defined (_AIX) && (OSMAJORVERSION==4) && (OSMINORVERSION==2) - if (getsockname (chooserFd, (struct sockaddr *)&in_addr, (size_t *)&len) < 0) -#else if (getsockname (chooserFd, (struct sockaddr *)&in_addr, &len) < 0) -#endif return -1; Debug ("Chooser socket port: %d\n", ntohs(in_addr.sin_port)); memmove( addr, (char *) &in_addr, len); diff --git a/cde/programs/dtlogin/sysauth.c b/cde/programs/dtlogin/sysauth.c index 6d409fa5a..59c476a70 100644 --- a/cde/programs/dtlogin/sysauth.c +++ b/cde/programs/dtlogin/sysauth.c @@ -45,10 +45,6 @@ ** ** Conditional compiles for HPUX: ** - ** OSMAJORVERSION < 8 - ** HP-UX 7.0/7.03 restricted license counting algorithms - ** are used. Otherwise HP-UX 8.0 and beyond is used - ** ** AUDIT HP C2 security enhancements; checks for existence of ** SECUREPASSWD file and authenticates user against ** password contained in that file. Also performs @@ -1022,7 +1018,7 @@ Authenticate( struct display *d, char *name, char *passwd, char **msg ) } #endif -#if defined(__OpenBSD__) && OSMAJORVERSION > 5 +#if defined(__OpenBSD__) /* * Use the OpenBSD getpwnam_shadow function to get the crypt()ed password */ diff --git a/cde/programs/dtlogin/vgauth.c b/cde/programs/dtlogin/vgauth.c index 5dbb0cf41..f490c12ed 100644 --- a/cde/programs/dtlogin/vgauth.c +++ b/cde/programs/dtlogin/vgauth.c @@ -45,10 +45,6 @@ ** ** Conditional compiles for HPUX: ** - ** OSMAJORVERSION < 8 - ** HP-UX 7.0/7.03 restricted license counting algorithms - ** are used. Otherwise HP-UX 8.0 and beyond is used - ** ** AUDIT HP C2 security enhancements; checks for existence of ** SECUREPASSWD file and authenticates user against ** password contained in that file. Also performs diff --git a/cde/programs/dtmail/libDtMail/Common/IO.C b/cde/programs/dtmail/libDtMail/Common/IO.C index 6847b18fe..c8ceb8858 100644 --- a/cde/programs/dtmail/libDtMail/Common/IO.C +++ b/cde/programs/dtmail/libDtMail/Common/IO.C @@ -91,10 +91,6 @@ extern "C" mntctl(int, int, char *); ssize_t writev(int, const struct iovec *, int); } -#if (OSMAJORVERSION==4) && (OSMINORVERSION==2) -/* Temporary hack till the /usr/lpp/xlC/include/unistd.h file is fixed. */ -extern "C" { int lockf(int, int, off_t); } -#endif #endif /* _AIX */ #include diff --git a/cde/programs/dtprintinfo/libUI/BaseUI.h b/cde/programs/dtprintinfo/libUI/BaseUI.h index 6544ce185..deb8cd066 100644 --- a/cde/programs/dtprintinfo/libUI/BaseUI.h +++ b/cde/programs/dtprintinfo/libUI/BaseUI.h @@ -35,26 +35,17 @@ #ifndef _BOOLEAN_ #define _BOOLEAN_ -#if (defined(sun) && OSMAJORVERSION <= 5 && OSMINORVERSION <= 3) +#if defined(sun) #include #define boolean boolean_t - #define true B_TRUE - #define false B_FALSE -#elif defined(sun) - #include - #define boolean boolean_t -#if defined(__XOPEN_OR_POSIX) - #define true _B_TRUE - #define false _B_FALSE -#else - #define true B_TRUE - #define false B_FALSE -#endif -#elif defined(__linux__) - #define false 0 - #define true 1 - #define boolean int -#elif defined(CSRG_BASED) +# if defined(__XOPEN_OR_POSIX) + #define true _B_TRUE + #define false _B_FALSE +# else + #define true B_TRUE + #define false B_FALSE +# endif +#elif defined(__linux__) || defined(CSRG_BASED) #include #define boolean bool #else diff --git a/cde/programs/dtprintinfo/objects/BaseObj.h b/cde/programs/dtprintinfo/objects/BaseObj.h index d6df46577..68219c0ce 100644 --- a/cde/programs/dtprintinfo/objects/BaseObj.h +++ b/cde/programs/dtprintinfo/objects/BaseObj.h @@ -36,26 +36,17 @@ #ifndef _BOOLEAN_ #define _BOOLEAN_ -#if (defined(sun) && OSMAJORVERSION <= 5 && OSMINORVERSION <= 3) +#if defined(sun) #include #define boolean boolean_t - #define true B_TRUE - #define false B_FALSE -#elif defined(sun) - #include - #define boolean boolean_t -#if defined(__XOPEN_OR_POSIX) - #define true _B_TRUE - #define false _B_FALSE -#else - #define true B_TRUE - #define false B_FALSE -#endif -#elif defined(__linux__) - #define false 0 - #define true 1 - #define boolean int -#elif defined(CSRG_BASED) +# if defined(__XOPEN_OR_POSIX) + #define true _B_TRUE + #define false _B_FALSE +# else + #define true B_TRUE + #define false B_FALSE +# endif +#elif defined(__linux__) || defined(CSRG_BASED) #include #define boolean bool #else diff --git a/cde/programs/dtprintinfo/util/Invoke.C b/cde/programs/dtprintinfo/util/Invoke.C index 8d6b61619..c9822d556 100644 --- a/cde/programs/dtprintinfo/util/Invoke.C +++ b/cde/programs/dtprintinfo/util/Invoke.C @@ -114,11 +114,7 @@ Invoke::Invoke(const char *command, // Command to Run memset(&oldsigquit_act, '\0', sizeof (struct sigaction)); memset(&oldsigint_act, '\0', sizeof (struct sigaction)); -#if (defined(sun) && OSMAJORVERSION == 5 && OSMINORVERSION <= 4) - action.sa_handler = (void (*)())SIG_IGN; -#else action.sa_handler = SIG_IGN; -#endif sigaction(SIGINT, &action, &oldsigint_act); sigaction(SIGQUIT, &action, &oldsigquit_act); diff --git a/cde/programs/dtsession/SmLock.c b/cde/programs/dtsession/SmLock.c index 83d1c183b..a8c476fe5 100644 --- a/cde/programs/dtsession/SmLock.c +++ b/cde/programs/dtsession/SmLock.c @@ -1827,7 +1827,7 @@ localAuthenticate( /* * Get password entry for 'name' or 'uid'. */ -#if defined(__OpenBSD__) && OSMAJORVERSION > 5 +#if defined(__OpenBSD__) if ((pwent = (name == NULL ? getpwuid_shadow(uid) : getpwnam_shadow(name))) == NULL) #else