From: Peter Tribble Date: Fri, 21 Mar 2014 23:37:00 +0000 (-0700) Subject: initial illumos port X-Git-Tag: 2.2.2~48 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=468d576030c4dcadf980ceea0bf8061ea64ed18f;p=oweals%2Fcde.git initial illumos port --- diff --git a/cde/config/cf/site.def b/cde/config/cf/site.def index ac114b69..14015924 100644 --- a/cde/config/cf/site.def +++ b/cde/config/cf/site.def @@ -14,6 +14,8 @@ XCOMM site: $TOG: site.def /main/23 1998/03/19 18:43:26 mgreess $ #ifdef BeforeVendorCF +# define LocalThreadsDefines + # include /* CDE uses a .C suffix for C++ source, not the default .cxx */ @@ -71,6 +73,8 @@ XCOMM site: $TOG: site.def /main/23 1998/03/19 18:43:26 mgreess $ # define X11ProjectRoot /usr # elif defined(FreeBSDArchitecture) # define X11ProjectRoot /usr/local +# elif defined(SunArchitecture) +# define X11ProjectRoot /usr # elif defined(OpenBSDArchitecture) # define X11ProjectRoot /usr/X11R6 # elif defined(NetBSDArchitecture) diff --git a/cde/config/cf/sun.cf b/cde/config/cf/sun.cf index d07aa84f..d47d097d 100644 --- a/cde/config/cf/sun.cf +++ b/cde/config/cf/sun.cf @@ -178,7 +178,9 @@ XCOMM SunPro C++ CplusplusCompilerMajorVersion./**/CplusplusCompilerMinorVersion # define XawI18nDefines -DHAS_WCHAR_H -DHAS_ISW_FUNCS # endif # endif -# if OSMinorVersion > 3 +# if OSMinorVersion > 10 +# define InstallCmd /usr/bin/ginstall +# elif OSMinorVersion > 3 # define InstallCmd /usr/ucb/install # endif # ifdef i386Architecture @@ -333,10 +335,17 @@ man_keywords:: @@\ #if !defined(UsePamLibrary) # if (OSMajorVersion > 5) || ((OSMajorVersion == 5) && (OSMinorVersion >= 4)) -# define UsePamLibrary YES +# define UsePamLibrary NO # endif #endif +#if (OSMajorVersion > 5) || ((OSMajorVersion == 5) && (OSMinorVersion >= 10)) +#define SharedLibXau YES +#define SharedXauRev 6 +#define SharedLibXdmcp YES +#define SharedXdmcpRev 6 +#endif + #define MotifDefines \ -DNO_ISDIR -DNO_REGCOMP -DNO_ALLOCA -DBOGUS_MB_MAX -DNO_CONST #define PamUnixDefines -DPAM_NIS diff --git a/cde/config/cf/sunLib.tmpl b/cde/config/cf/sunLib.tmpl index a21919c2..0e8c8c2f 100644 --- a/cde/config/cf/sunLib.tmpl +++ b/cde/config/cf/sunLib.tmpl @@ -77,7 +77,7 @@ ICONV_INBUF_DEFINE = -DICONV_INBUF_CONST=const UNSHARED_CXXLIB = -static -lC # elif HasSunCplusplus # if CplusplusCompilerMajorVersion > 3 -UNSHARED_CXXLIB = -Bstatic -L/opt/SUNWspro/SC4.0/lib -lC -Bdynamic +UNSHARED_CXXLIB = -lC # else UNSHARED_CXXLIB = -Bstatic -lC -Bdynamic -lm -lc -Bstatic # endif diff --git a/cde/lib/DtHelp/Layout.c b/cde/lib/DtHelp/Layout.c index bb939ed1..90904633 100644 --- a/cde/lib/DtHelp/Layout.c +++ b/cde/lib/DtHelp/Layout.c @@ -332,7 +332,7 @@ static const _DtCvSegmentI BlankTableCell = _DtCvCONTAINER, /* type */ -1, /* link_idx */ { /* container info */ - { NULL }, /* id */ + NULL, /* id */ NULL, /* justify_char */ _DtCvDYNAMIC, /* type */ _DtCvBORDER_NONE, /* border */ diff --git a/cde/lib/DtSvc/DtUtil2/SunDtHelp.c b/cde/lib/DtSvc/DtUtil2/SunDtHelp.c index b6c66c5e..bb72ed48 100644 --- a/cde/lib/DtSvc/DtUtil2/SunDtHelp.c +++ b/cde/lib/DtSvc/DtUtil2/SunDtHelp.c @@ -77,7 +77,7 @@ int SUNWDtHelpdlopen() _DtSvcProcessLock(); pmySUNWProcList = (SUNWHelpProcList *)malloc(sizeof(SUNWHelpProcList)); - libDtHelpHandle = dlopen("libDtHelp.so.1", RTLD_LAZY | RTLD_GLOBAL); + libDtHelpHandle = dlopen("libDtHelp.so.2.1", RTLD_LAZY | RTLD_GLOBAL); if (libDtHelpHandle == NULL) { char *my_err_msg; diff --git a/cde/lib/DtSvc/Imakefile b/cde/lib/DtSvc/Imakefile index e3e9908b..f2dc2f72 100644 --- a/cde/lib/DtSvc/Imakefile +++ b/cde/lib/DtSvc/Imakefile @@ -30,7 +30,7 @@ INCLUDES = -I. #ifdef SharedDtSvcReqs #ifdef SunArchitecture -REQUIREDLIBS = SharedDtSvcReqs -L/opt/SUNWspro/SC4.0/lib -Bstatic -lC +REQUIREDLIBS = SharedDtSvcReqs -lC -lCrun SHLIBLDFLAGS = -G #else REQUIREDLIBS = SharedDtSvcReqs diff --git a/cde/lib/DtSvc/include/bms/sbstdinc.h b/cde/lib/DtSvc/include/bms/sbstdinc.h index ed5ae36b..8061e5a7 100644 --- a/cde/lib/DtSvc/include/bms/sbstdinc.h +++ b/cde/lib/DtSvc/include/bms/sbstdinc.h @@ -62,7 +62,7 @@ #if !(defined(apollo) && defined(__bsd)) && !defined(CSRG_BASED) #if defined(__STDC__) -#if !defined(linux) && !defined(__osf__) && !defined(_XFUNCS_H_) +#if !defined(linux) && !defined(__osf__) && !defined(_XFUNCS_H_) && !defined(sun) extern void bcopy(char *b1, char *b2, int length); extern int bcmp(char *b1, char *b2, int length); extern void bzero(char *b, int length); diff --git a/cde/lib/DtSvc/include/codelibs/stringx.h b/cde/lib/DtSvc/include/codelibs/stringx.h index 346f3845..5981603d 100644 --- a/cde/lib/DtSvc/include/codelibs/stringx.h +++ b/cde/lib/DtSvc/include/codelibs/stringx.h @@ -75,7 +75,7 @@ extern "C" #ifdef __cplusplus char *strtokx(char *&ptr, const char *sep); -# if !defined(__osf__) && !defined(linux) && !defined(CSRG_BASED) +# if !defined(__osf__) && !defined(linux) && !defined(sun) && !defined(CSRG_BASED) char **strsep(const char *str, const char *sep, boolean whsp = TRUE, int *num = NULL); # if !defined(__osf__) @@ -85,7 +85,7 @@ extern "C" #else /* __STDC__ */ char *strtokx(char **ptr, const char *sep); -# if !defined(linux) && !defined(CSRG_BASED) +# if !defined(linux) && !defined(sun) && !defined(CSRG_BASED) char **strsep(const char *str, const char *sep, boolean whsp, int *num); #endif diff --git a/cde/lib/tt/bin/shell/mover.C b/cde/lib/tt/bin/shell/mover.C index f3072380..79e9cdd3 100644 --- a/cde/lib/tt/bin/shell/mover.C +++ b/cde/lib/tt/bin/shell/mover.C @@ -38,7 +38,7 @@ #if defined(__osf__) || defined(linux) || defined(CSRG_BASED) #include #else -#if !defined(USL) && !defined(__uxp__) +#if !defined(USL) && !defined(__uxp__) && !defined(sun) #include #endif #endif diff --git a/cde/lib/tt/bin/shell/remover.C b/cde/lib/tt/bin/shell/remover.C index f96b32ce..68634d28 100644 --- a/cde/lib/tt/bin/shell/remover.C +++ b/cde/lib/tt/bin/shell/remover.C @@ -38,7 +38,7 @@ #if defined(__osf__) || defined(linux) || defined(CSRG_BASED) #include #else -#if !defined(USL) && !defined(__uxp__) +#if !defined(USL) && !defined(__uxp__) && !defined(sun) #include #endif #endif diff --git a/cde/lib/tt/bin/ttauth/ttauth.h b/cde/lib/tt/bin/ttauth/ttauth.h index 32ccf1a2..80a1e33f 100644 --- a/cde/lib/tt/bin/ttauth/ttauth.h +++ b/cde/lib/tt/bin/ttauth/ttauth.h @@ -58,7 +58,7 @@ typedef int Bool; extern char *ProgramName; -#if !defined(linux) && !defined(CSRG_BASED) +#if !defined(linux) && !defined(CSRG_BASED) && !defined(sun) extern char *malloc(), *realloc(); #endif int process_command(), auth_initialize(), auth_finalize(); diff --git a/cde/lib/tt/bin/ttdbserverd/db_server_globals.h b/cde/lib/tt/bin/ttdbserverd/db_server_globals.h index 4ea174da..c20b5a50 100644 --- a/cde/lib/tt/bin/ttdbserverd/db_server_globals.h +++ b/cde/lib/tt/bin/ttdbserverd/db_server_globals.h @@ -38,6 +38,9 @@ #define _DB_SERVER_GLOBALS_H #include +#if !defined(NGROUPS) +#define NGROUPS NGROUPS_MAX +#endif #if defined(OPT_GARBAGE_THREADS) #include diff --git a/cde/lib/tt/bin/tttar/tttar.C b/cde/lib/tt/bin/tttar/tttar.C index cf0875c8..bff0a3ed 100644 --- a/cde/lib/tt/bin/tttar/tttar.C +++ b/cde/lib/tt/bin/tttar/tttar.C @@ -37,10 +37,10 @@ #include #include #include -#if defined(__osf__) || defined(linux) || defined(CSRG_BASED) +#if defined(__osf__) || defined(linux) || defined(sun) || defined(CSRG_BASED) #include #else -#if !defined(USL) && !defined(__uxp__) +#if !defined(USL) && !defined(__uxp__) && !defined(sun) #include #endif #endif diff --git a/cde/lib/tt/bin/tttar/tttar_api.C b/cde/lib/tt/bin/tttar/tttar_api.C index 29c002af..78840035 100644 --- a/cde/lib/tt/bin/tttar/tttar_api.C +++ b/cde/lib/tt/bin/tttar/tttar_api.C @@ -33,7 +33,7 @@ */ #include -#if defined(__osf__) || defined(linux) || defined(CSRG_BASED) +#if defined(__osf__) || defined(linux) || defined(CSRG_BASED) || defined(sun) #include #else #ifndef USL diff --git a/cde/lib/tt/bin/tttar/tttar_spec.C b/cde/lib/tt/bin/tttar/tttar_spec.C index 659bf6ff..4833de67 100644 --- a/cde/lib/tt/bin/tttar/tttar_spec.C +++ b/cde/lib/tt/bin/tttar/tttar_spec.C @@ -32,7 +32,7 @@ * */ -#if defined(__osf__) || defined(linux) || defined(CSRG_BASED) +#if defined(__osf__) || defined(linux) || defined(CSRG_BASED) || defined(sun) #include #else #if defined (USL) || defined(__uxp__) diff --git a/cde/lib/tt/lib/Imakefile b/cde/lib/tt/lib/Imakefile index 54b4876a..9660c370 100644 --- a/cde/lib/tt/lib/Imakefile +++ b/cde/lib/tt/lib/Imakefile @@ -45,7 +45,7 @@ INCLUDES = -I. #ifdef SharedTtReqs #ifdef SunArchitecture -REQUIREDLIBS = SharedTtReqs -L/opt/SUNWspro/SC4.0/lib -Bstatic -lC +REQUIREDLIBS = SharedTtReqs -lC -lCrun SHLIBLDFLAGS = -G #else REQUIREDLIBS = SharedTtReqs diff --git a/cde/lib/tt/lib/mp/mp_message.C b/cde/lib/tt/lib/mp/mp_message.C index 06afb245..02687e3c 100644 --- a/cde/lib/tt/lib/mp/mp_message.C +++ b/cde/lib/tt/lib/mp/mp_message.C @@ -1284,7 +1284,7 @@ print(const _Tt_ostream &os) const os << "otype:\t\t" << _otype << "\n"; } if (! _sender.is_null()) { - os << "sender:\t\t[" << _uid << "/" << _gid << "] "; + os << "sender:\t\t[" << (unsigned long)_uid << "/" << (unsigned long)_gid << "] "; _sender->print( os ); } if (_sender_ptype.len() > 0) { diff --git a/cde/lib/tt/lib/util/tt_host.C b/cde/lib/tt/lib/util/tt_host.C index 60e80512..223007b2 100644 --- a/cde/lib/tt/lib/util/tt_host.C +++ b/cde/lib/tt/lib/util/tt_host.C @@ -48,7 +48,7 @@ extern "C" in_addr_t inet_addr(const char *); #ifdef __osf__ #include #else -#if !defined(USL) && !defined(__uxp__) && !defined(linux) && !defined(CSRG_BASED) +#if !defined(USL) && !defined(__uxp__) && !defined(linux) && !defined(CSRG_BASED) && !defined(sun) #include #endif #endif /* __osf */ diff --git a/cde/lib/tt/lib/util/tt_log.C b/cde/lib/tt/lib/util/tt_log.C index 48955ad2..81c2d4c5 100644 --- a/cde/lib/tt/lib/util/tt_log.C +++ b/cde/lib/tt/lib/util/tt_log.C @@ -37,7 +37,7 @@ #ifdef __osf__ #include #else -#if !defined (USL) && !defined(__uxp__) && !defined(linux) && !defined(CSRG_BASED) +#if !defined (USL) && !defined(__uxp__) && !defined(linux) && !defined(CSRG_BASED) && !defined(sun) #include #endif #endif /* __osf__ */ diff --git a/cde/lib/tt/lib/util/tt_xdr_utils.h b/cde/lib/tt/lib/util/tt_xdr_utils.h index db1bfd3b..b450564f 100644 --- a/cde/lib/tt/lib/util/tt_xdr_utils.h +++ b/cde/lib/tt/lib/util/tt_xdr_utils.h @@ -55,7 +55,7 @@ class _Tt_xdr_size_stream : public _Tt_allocated { #ifdef __DECCXX XDR::xdr_ops ops; #else - struct XDR::xdr_ops ops; + struct xdr_ops ops; #endif }; diff --git a/cde/programs/dtappbuilder/src/libAButil/util.c b/cde/programs/dtappbuilder/src/libAButil/util.c index 572873b2..f8a68054 100644 --- a/cde/programs/dtappbuilder/src/libAButil/util.c +++ b/cde/programs/dtappbuilder/src/libAButil/util.c @@ -223,7 +223,7 @@ util_vfork() #ifdef __cplusplus extern "C" { #endif -#if defined(__uxp__) || defined(__hpux) || (defined(sun) && OSMAJORVERSION >= 5 && OSMINORVERSION >= 4) +#if defined(__uxp__) || defined(__hpux) || (defined(sun) && OSMAJORVERSION >= 5 && OSMINORVERSION >= 4 && OSMINORVERSION <=10 ) extern int putenv(const char *string); #elif !(defined(__osf__) || defined(__aix) || defined(__NetBSD__)) extern int putenv(char *string); diff --git a/cde/programs/dtcalc/calctool.c b/cde/programs/dtcalc/calctool.c index 3bfbdcf4..44e5aaad 100644 --- a/cde/programs/dtcalc/calctool.c +++ b/cde/programs/dtcalc/calctool.c @@ -46,7 +46,7 @@ #include "calctool.h" #include "ds_common.h" -#ifdef sun +#ifdef legacysun /* Copied from math.h */ struct exception { diff --git a/cde/programs/dtcreate/Imakefile b/cde/programs/dtcreate/Imakefile index 559834e9..07180fb3 100644 --- a/cde/programs/dtcreate/Imakefile +++ b/cde/programs/dtcreate/Imakefile @@ -42,7 +42,7 @@ SYS_LIBRARIES = -lm -liconv #endif #if defined (SunArchitecture) -SYS_LIBRARIES = -lm -ldl -L/opt/SUNWspro/SC2.0.1 -lC +SYS_LIBRARIES = -lm -ldl -lC #endif /* SunArchitecture */ #if defined (USLArchitecture) diff --git a/cde/programs/dtdocbook/tcl/Imakefile b/cde/programs/dtdocbook/tcl/Imakefile index 45aadcf3..0b0af5c7 100644 --- a/cde/programs/dtdocbook/tcl/Imakefile +++ b/cde/programs/dtdocbook/tcl/Imakefile @@ -30,7 +30,7 @@ TCL_LIBRARY = $(prefix)/tcl$(VERSION) #if defined(SunArchitecture) EXTRA_DEFINES = -DTCL_LIBRARY=\"${TCL_LIBRARY}\" \ - -DNO_UNION_WAIT -DHAVE_UNISTD_H \ + -DNO_UNION_WAIT -DHAVE_UNISTD_H -DNEED_MATHERR \ -DTCL_GOT_TIMEZONE #elif defined(IBMArchitecture) diff --git a/cde/programs/dtinfo/tools/misc/msgsets.C b/cde/programs/dtinfo/tools/misc/msgsets.C index e6a86c0d..ae63714d 100644 --- a/cde/programs/dtinfo/tools/misc/msgsets.C +++ b/cde/programs/dtinfo/tools/misc/msgsets.C @@ -42,7 +42,7 @@ #ifdef __cplusplus #include -#if !defined(__DECCXX) && !defined(USL) && !defined(linux) && !defined(CSRG_BASED) +#if !defined(__DECCXX) && !defined(USL) && !defined(linux) && !defined(CSRG_BASED) && !defined(sun) #include #else #include diff --git a/cde/programs/dtlogin/Imakefile b/cde/programs/dtlogin/Imakefile index 84d11d92..7332e462 100644 --- a/cde/programs/dtlogin/Imakefile +++ b/cde/programs/dtlogin/Imakefile @@ -59,7 +59,14 @@ SOLARIS_OBJS = #endif #if defined(SunArchitecture) && !UsePamLibrary +/* Unsure when libauth went away */ +# if (OSMajorVersion == 5) && (OSMinorVersion < 5) PAM_LIB = -lauth +# else +PAM_SRCS = pam_svc.c +PAM_OBJS = pam_svc.o +PAM_LIB = -lpam +# endif #endif XDMDIR = $(CDE_LOGFILES_TOP) @@ -99,13 +106,12 @@ SYS_LIBRARIES = -lsec * on Solaris 2.4 and run on Solaris 2.5. In Solaris 2.4 some of * libcmd.a functions are also in libauth.so. But on Solaris 2.5 * these Sun private functions have been removed from libauth.so. */ -SYS_LIBRARIES = -lm -ldl -lgen -lresolv -lC -lbsm -lcmd -lauth $(PAM_LIB) +SYS_LIBRARIES = -lm -ldl -lgen -lresolv -lC -lbsm -lcmd $(PAM_LIB) + EXTRA_DEFINES = -DPAM # if UsePamLibrary EXTRA_DEFINES = -DPAM -# else - EXTRA_DEFINES = -DSUNAUTH # endif #endif diff --git a/cde/programs/dtlogin/pam_svc.c b/cde/programs/dtlogin/pam_svc.c index e878d6cd..4b252513 100644 --- a/cde/programs/dtlogin/pam_svc.c +++ b/cde/programs/dtlogin/pam_svc.c @@ -150,7 +150,7 @@ PamAuthenticate ( char* prog_name, return(PAM_AUTH_ERR); } -#ifdef sun +#ifdef legacysun /* Solaris BSM Audit trail */ audit_login_save_host(display_name); @@ -167,7 +167,7 @@ PamAuthenticate ( char* prog_name, status = pam_authenticate( pamh, 0 ); pam_auth_trys++; -#ifdef sun +#ifdef legacysun pwd = getpwnam(user); audit_login_save_pw(pwd); @@ -262,7 +262,7 @@ PamAccounting( char* prog_name, Debug("PamAccounting: USER_PROCESS open_session error=%d\n", status); } -#ifdef sun +#ifdef legacysun if (status == PAM_SUCCESS) audit_login_success(); #endif session_type = SOLARIS_LOGIN; @@ -450,7 +450,7 @@ login_conv(int num_msg, struct pam_message **msg, if (saved_user_passwd != NULL) { r->resp = (char *) malloc(strlen(saved_user_passwd)+1); if (r->resp == NULL) { - __pam_free_resp(num_msg, *response); + /* __pam_free_resp(num_msg, *response); */ *response = NULL; return (PAM_CONV_ERR); } diff --git a/cde/programs/dtlogin/sysauth.c b/cde/programs/dtlogin/sysauth.c index b6389104..d6280da5 100644 --- a/cde/programs/dtlogin/sysauth.c +++ b/cde/programs/dtlogin/sysauth.c @@ -1430,7 +1430,7 @@ Authenticate( struct display *d, char *name, char *passwd, char **msg ) case PAM_SUCCESS: return(VF_OK); - case PAM_AUTHTOKEN_REQD: + case PAM_NEW_AUTHTOK_REQD: return(VF_PASSWD_AGED); default: diff --git a/cde/programs/dtmail/MotifApp/SelectFileCmd.C b/cde/programs/dtmail/MotifApp/SelectFileCmd.C index d67ff94a..84678781 100644 --- a/cde/programs/dtmail/MotifApp/SelectFileCmd.C +++ b/cde/programs/dtmail/MotifApp/SelectFileCmd.C @@ -88,7 +88,7 @@ extern XtPointer _XmStringUngenerate ( } -extern int forceUpdate( Widget ); +extern void forceUpdate( Widget ); SelectFileCmd::SelectFileCmd (const char * name, const char * label, diff --git a/cde/programs/dtmail/dtmail/DmxUtils.C b/cde/programs/dtmail/dtmail/DmxUtils.C index c283d78a..b61305b3 100644 --- a/cde/programs/dtmail/dtmail/DmxUtils.C +++ b/cde/programs/dtmail/dtmail/DmxUtils.C @@ -201,16 +201,16 @@ dispname(const char *hdr) if (hdr == 0) return 0; - if (((cp = strchr(hdr, '<')) != 0) && (cp > hdr)) { + if (((cp = const_cast (strchr(hdr, '<'))) != 0) && (cp > hdr)) { *cp = 0; - if ((*hdr == '"') && ((cp = strrchr(++hdr, '"')) != 0)) + if ((*hdr == '"') && ((cp = const_cast (strrchr(++hdr, '"'))) != 0)) *cp = 0; return (char *)hdr; - } else if ((cp = strchr(hdr, '(')) != 0) { + } else if ((cp = const_cast (strchr(hdr, '('))) != 0) { hdr = ++cp; - if ((cp = strchr(hdr, '+')) != 0) + if ((cp = const_cast (strchr(hdr, '+'))) != 0) *cp = 0; - if ((cp = strrchr(hdr, ')')) != 0) + if ((cp = const_cast (strrchr(hdr, ')'))) != 0) *cp = 0; return (char *)hdr; } diff --git a/cde/programs/dtmail/dtmail/FindDialog.C b/cde/programs/dtmail/dtmail/FindDialog.C index ad4169c6..e8f9cf4f 100644 --- a/cde/programs/dtmail/dtmail/FindDialog.C +++ b/cde/programs/dtmail/dtmail/FindDialog.C @@ -728,7 +728,7 @@ FindDialog::compareMessage(DtMailMessageHandle handle) return(found); } -#if !defined(CSRG_BASED) && !defined(linux) +#if !defined(CSRG_BASED) && !defined(linux) && !defined(sun) // // See if string 'toFind' is anyware in string 'str'. // A case-insensitive version of strstr(). diff --git a/cde/programs/dtmail/dtmail/RoamApp.C b/cde/programs/dtmail/dtmail/RoamApp.C index e7213e23..354d6c6d 100644 --- a/cde/programs/dtmail/dtmail/RoamApp.C +++ b/cde/programs/dtmail/dtmail/RoamApp.C @@ -957,6 +957,12 @@ Usage(char *progname) nl_catd DT_catd = (nl_catd) -1; // catgets file descriptor +#if defined(reallyoldsun) || defined(USL) +#define SA_HANDLER_TYPE void (*)(void) +#else +#define SA_HANDLER_TYPE void (*)(int) +#endif + void RoamApp::initialize(int *argcp, char **argv) { char **av = argv; @@ -991,11 +997,7 @@ void RoamApp::initialize(int *argcp, char **argv) action = &action_buf; memset((void*) action, 0, sizeof(struct sigaction)); -#ifdef USL - action->sa_handler = (void (*)())panicQuitSignalHandler; -#else - action->sa_handler = panicQuitSignalHandler; -#endif + action->sa_handler = (SA_HANDLER_TYPE) panicQuitSignalHandler; action->sa_flags = 0; sigaction(SIGHUP, action, NULL); sigaction(SIGINT, action, NULL); diff --git a/cde/programs/dtmail/dtmail/RoamCmds.C b/cde/programs/dtmail/dtmail/RoamCmds.C index 46d130f9..7efe9692 100644 --- a/cde/programs/dtmail/dtmail/RoamCmds.C +++ b/cde/programs/dtmail/dtmail/RoamCmds.C @@ -143,7 +143,7 @@ extern XtPointer _XmStringUngenerate ( #include -extern int forceUpdate( Widget ); +extern void forceUpdate( Widget ); RoamCmd::RoamCmd (char *name, char *label, int active, RoamMenuWindow *window) diff --git a/cde/programs/dtmail/dtmail/RoamInterruptibleCmd.C b/cde/programs/dtmail/dtmail/RoamInterruptibleCmd.C index 81177c18..07ee31d2 100644 --- a/cde/programs/dtmail/dtmail/RoamInterruptibleCmd.C +++ b/cde/programs/dtmail/dtmail/RoamInterruptibleCmd.C @@ -48,7 +48,7 @@ #include #include #include -extern int forceUpdate( Widget ); +extern void forceUpdate( Widget ); RoamInterruptibleCmd::RoamInterruptibleCmd ( char *name, diff --git a/cde/programs/dtmail/dtmailpr/utils.C b/cde/programs/dtmail/dtmailpr/utils.C index 2246321c..86cd8301 100644 --- a/cde/programs/dtmail/dtmailpr/utils.C +++ b/cde/programs/dtmail/dtmailpr/utils.C @@ -190,16 +190,16 @@ dispname(const char *hdr) if (hdr == 0) return 0; - if (((cp = strchr(hdr, '<')) != 0) && (cp > hdr)) { + if (((cp = const_cast (strchr(hdr, '<'))) != 0) && (cp > hdr)) { *cp = 0; - if ((*hdr == '"') && ((cp = strrchr(++hdr, '"')) != 0)) + if ((*hdr == '"') && ((cp = const_cast (strrchr(++hdr, '"'))) != 0)) *cp = 0; return (char *)hdr; - } else if ((cp = strchr(hdr, '(')) != 0) { + } else if ((cp = const_cast (strchr(hdr, '('))) != 0) { hdr = ++cp; - if ((cp = strchr(hdr, '+')) != 0) + if ((cp = const_cast (strchr(hdr, '+'))) != 0) *cp = 0; - if ((cp = strrchr(hdr, ')')) != 0) + if ((cp = const_cast (strrchr(hdr, ')'))) != 0) *cp = 0; return (char *)hdr; } diff --git a/cde/programs/dtmail/include/DtMail/Buffer.hh b/cde/programs/dtmail/include/DtMail/Buffer.hh index 0d6c68cd..54efac52 100644 --- a/cde/programs/dtmail/include/DtMail/Buffer.hh +++ b/cde/programs/dtmail/include/DtMail/Buffer.hh @@ -103,7 +103,7 @@ class BufferMemory : public Buffer { virtual int getSize(void); // get total size of the buffer private: -#if !defined(linux) && !defined(CSRG_BASED) +#if !defined(linux) && !defined(CSRG_BASED) && !defined(sun) class Chunk; #endif diff --git a/cde/programs/dtmail/libDtMail/Common/DtMailServer.C b/cde/programs/dtmail/libDtMail/Common/DtMailServer.C index 7cde4ca2..887bdab9 100644 --- a/cde/programs/dtmail/libDtMail/Common/DtMailServer.C +++ b/cde/programs/dtmail/libDtMail/Common/DtMailServer.C @@ -160,7 +160,7 @@ DtMailServer::set_password(char *password) // // len - Length of message. // -#if defined(sun) || defined(USL) +#if defined(reallyoldsun) || defined(USL) #define SA_HANDLER_TYPE void (*)(void) #else #define SA_HANDLER_TYPE void (*)(int) @@ -231,7 +231,7 @@ DtMailServer::ptrans_retrieve_readandappend( // Determine if we are done with this message. if (proto_is_delimited()) { - char *s = strrchr((const char *) _msgbuf, (int) '.'); + char *s = const_cast (strrchr((const char *) _msgbuf, (int) '.')); if (s && (s == _msgbuf || *(s-1) == '\n') && diff --git a/cde/programs/dtmail/libDtMail/Common/Session.C b/cde/programs/dtmail/libDtMail/Common/Session.C index 9086df3d..d42c553c 100644 --- a/cde/programs/dtmail/libDtMail/Common/Session.C +++ b/cde/programs/dtmail/libDtMail/Common/Session.C @@ -783,7 +783,7 @@ DtMail::Session::getRelativePath(DtMailEnv & error, const char * path) free(old_exp); // Check to see if the path starts with the folder path. - char * matched_path = strstr(path, exp_name); + char * matched_path = const_cast(strstr(path, exp_name)); if (matched_path == path) { // Yes it does, make it a relative path to the folder dir. int folder_path_length = strlen(exp_name); diff --git a/cde/programs/dtmail/libDtMail/RFC/MIMEBodyPart.C b/cde/programs/dtmail/libDtMail/RFC/MIMEBodyPart.C index 922a0298..1e631140 100644 --- a/cde/programs/dtmail/libDtMail/RFC/MIMEBodyPart.C +++ b/cde/programs/dtmail/libDtMail/RFC/MIMEBodyPart.C @@ -938,9 +938,9 @@ MIMEBodyPart::csFromContentType(DtMailValueSeq &value) } } // Get charset value - val_ptr = strstr(val, "charset="); + val_ptr = const_cast (strstr(val, "charset=")); if ( val_ptr == NULL ) { - val_ptr = strstr(val, "CHARSET="); + val_ptr = const_cast (strstr(val, "CHARSET=")); } if ( val_ptr == NULL ) { return NULL; diff --git a/cde/programs/dtmail/libDtMail/RFC/MIMEPartial.C b/cde/programs/dtmail/libDtMail/RFC/MIMEPartial.C index e85d9de0..74150270 100644 --- a/cde/programs/dtmail/libDtMail/RFC/MIMEPartial.C +++ b/cde/programs/dtmail/libDtMail/RFC/MIMEPartial.C @@ -122,7 +122,7 @@ getNamedValueString(const char *string, const char *name) results = strdup(&string[offset + nameLen + 1]); if (*results == '"') { results++; - stringEnd = strchr(results, '"'); + stringEnd = const_cast (strchr(results, '"')); if (stringEnd != NULL) { *stringEnd = '\0'; } @@ -420,7 +420,7 @@ RFCMailBox::_assemblePartial(DtMailEnv & error, // embHeader1StLen = (int) length; embHeader1St = (const char *)contents; - endHeader = strstr((const char *)contents, "\n\n"); + endHeader = const_cast (strstr((const char *)contents, "\n\n")); if (endHeader != NULL) { RFCEnvelope embEnv(error, diff --git a/cde/programs/dtmail/libDtMail/RFC/RFCMailBox.C b/cde/programs/dtmail/libDtMail/RFC/RFCMailBox.C index b0be2f29..9696424e 100644 --- a/cde/programs/dtmail/libDtMail/RFC/RFCMailBox.C +++ b/cde/programs/dtmail/libDtMail/RFC/RFCMailBox.C @@ -4542,6 +4542,12 @@ RFCMailBox::startAutoSave(DtMailEnv & error, _session->removeEventRoutine(error, PollEntry, this); } +#if defined(reallyoldsun) || defined(USL) +#define SA_HANDLER_TYPE void (*)(void) +#else +#define SA_HANDLER_TYPE void (*)(int) +#endif + void RFCMailBox::dumpMaps(const char *str) { @@ -4573,11 +4579,7 @@ RFCMailBox::dumpMaps(const char *str) */ (void) sigemptyset(&sig_act.sa_mask); sig_act.sa_flags = 0; -#if defined(USL) - sig_act.sa_handler = (void(*)())SigBusHandler; -#else - sig_act.sa_handler = SigBusHandler; -#endif /* USL */ + sig_act.sa_handler = (SA_HANDLER_TYPE) SigBusHandler; sigaction(SIGBUS, &sig_act, &old_sig_act); sigbus_env_valid = 1; if (setjmp(sigbus_env) == 0) { diff --git a/cde/programs/dtpdm/Imakefile b/cde/programs/dtpdm/Imakefile index 23b82a99..1c8ff0c1 100644 --- a/cde/programs/dtpdm/Imakefile +++ b/cde/programs/dtpdm/Imakefile @@ -26,7 +26,7 @@ SYS_LIBRARIES = -lmsaa -liconv #endif #if defined (SunArchitecture) -SYS_LIBRARIES = -lintl -L/opt/SUNWspro/SC2.0.1 -lm -lgen -ldl -lC +SYS_LIBRARIES = -lintl -lm -lgen -ldl -lC #endif PROGRAMS = dtpdm diff --git a/cde/programs/dtprintinfo/libUI/BaseUI.h b/cde/programs/dtprintinfo/libUI/BaseUI.h index 66e0aff5..6298b352 100644 --- a/cde/programs/dtprintinfo/libUI/BaseUI.h +++ b/cde/programs/dtprintinfo/libUI/BaseUI.h @@ -40,6 +40,16 @@ #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 diff --git a/cde/programs/dtprintinfo/objects/BaseObj.h b/cde/programs/dtprintinfo/objects/BaseObj.h index c85cd035..0e0ff4d8 100644 --- a/cde/programs/dtprintinfo/objects/BaseObj.h +++ b/cde/programs/dtprintinfo/objects/BaseObj.h @@ -41,6 +41,16 @@ #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 diff --git a/cde/programs/dtscreen/dtscreen.h b/cde/programs/dtscreen/dtscreen.h index 8e27aae4..de7334a7 100644 --- a/cde/programs/dtscreen/dtscreen.h +++ b/cde/programs/dtscreen/dtscreen.h @@ -111,7 +111,7 @@ struct passwd { #include #define getpwnam getspnam #endif -#if !(defined(_AIX) || defined(hpux)) +#if !(defined(_AIX) || defined(hpux) || defined(sun)) # define srandom srand # define random rand # define MAXRAND (32767.0) diff --git a/cde/programs/dtscreen/usleep.c b/cde/programs/dtscreen/usleep.c index ca89c528..08968bbd 100644 --- a/cde/programs/dtscreen/usleep.c +++ b/cde/programs/dtscreen/usleep.c @@ -41,7 +41,7 @@ #include "dtscreen.h" -#if !defined(_AIX) && !defined(hpV4) && !defined(linux) && !defined(CSRG_BASED) +#if !defined(_AIX) && !defined(hpV4) && !defined(linux) && !defined(sun) && !defined(CSRG_BASED) int usleep(unsigned long usec) { diff --git a/cde/programs/dtscreen/worm.c b/cde/programs/dtscreen/worm.c index a806facc..acf3ebda 100644 --- a/cde/programs/dtscreen/worm.c +++ b/cde/programs/dtscreen/worm.c @@ -88,7 +88,7 @@ typedef struct { int size[MAXCOLORS]; } wormstruct; -#if !defined(CSRG_BASED) +#if !defined(CSRG_BASED) && !defined(sun) int round(x) float x; diff --git a/cde/programs/dtterm/util/logger.c b/cde/programs/dtterm/util/logger.c index dc5c8cca..ab2ca281 100644 --- a/cde/programs/dtterm/util/logger.c +++ b/cde/programs/dtterm/util/logger.c @@ -72,7 +72,7 @@ main(int argc, char **argv) } /* init data... */ -#if defined(USL) || defined(__uxp__) || defined(linux) || defined(CSRG_BASED) +#if defined(USL) || defined(__uxp__) || defined(linux) || defined(sun) || defined(CSRG_BASED) (void) memset((void *) &myaddr_in, (int) '\0', sizeof(myaddr_in)); #else (void) memset(myaddr_in, '\0', sizeof(myaddr_in));