From 33ce240b40b1fde502b0f6b3e5fb4b50113dae99 Mon Sep 17 00:00:00 2001
From: Michele Calgaro <michele.calgaro@yahoo.it>
Date: Fri, 16 Jan 2026 16:17:53 +0900
Subject: Remove support for HPUX, which is discontinued and does not provide a
 c++17 complaint compiler.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
---
 dcop/KDE-ICE/Xtrans.c                        |  4 +-
 dcop/KDE-ICE/Xtransint.h                     |  2 +-
 dcop/KDE-ICE/Xtranssock.c                    | 71 ++--------------------------
 dcop/dcopidl/scanner.cpp                     |  4 +-
 dcop/dcopidl/scanner.ll                      |  4 +-
 tdecore/kpty.cpp                             | 13 ++---
 tdecore/netsupp.cpp                          |  4 --
 tdeinit/setproctitle.h                       |  4 --
 tdeio/kssl/kopenssl.cpp                      |  8 +---
 tdeio/tdeio/kurlcompletion.cpp               |  2 +-
 tdeio/tdeio/tdefilemetainfo.h                |  6 ---
 tdeprint/cups/cupsdconf2/cupsd.conf.template |  3 --
 tdeprint/fooparser.cpp                       |  7 ---
 tdeprint/lpdunix/kmlpdunixmanager.cpp        |  2 +-
 tdersync/tdersync.cpp                        |  4 +-
 15 files changed, 19 insertions(+), 119 deletions(-)

diff --git a/dcop/KDE-ICE/Xtrans.c b/dcop/KDE-ICE/Xtrans.c
index c85a9263d..ec2502a0b 100644
--- a/dcop/KDE-ICE/Xtrans.c
+++ b/dcop/KDE-ICE/Xtrans.c
@@ -678,7 +678,7 @@ TRANS(SetOption) (XtransConnInfo ciptr, int option, int arg)
 	    break;
 	case 1: /* Set to non-blocking mode */
 
-#if defined(O_NONBLOCK) && (!defined(ultrix) && !defined(hpux) && !defined(AIXV3) && !defined(uniosu) && !defined(__EMX__) && !defined(SCO)) && !defined(__QNX__)
+#if defined(O_NONBLOCK) && (!defined(ultrix) && !defined(AIXV3) && !defined(uniosu) && !defined(__EMX__) && !defined(SCO)) && !defined(__QNX__)
 	    ret = fcntl (fd, F_GETFL, 0);
 	    if (ret != -1)
 		ret = fcntl (fd, F_SETFL, ret | O_NONBLOCK);
@@ -1309,7 +1309,7 @@ static int TRANS(WriteV) (XtransConnInfo ciptr, struct iovec *iov, int iovcnt)
 #endif /* SYSV && i386 || _WIN32 || __sxg__ */
 
 
-#if (defined(_POSIX_SOURCE) && !defined(AIXV3) && !defined(__QNX__)) || defined(hpux) || defined(USG) || defined(SVR4) || defined(SCO)
+#if (defined(_POSIX_SOURCE) && !defined(AIXV3) && !defined(__QNX__)) || defined(USG) || defined(SVR4) || defined(SCO)
 #ifndef NEED_UTSNAME
 #define NEED_UTSNAME
 #endif
diff --git a/dcop/KDE-ICE/Xtransint.h b/dcop/KDE-ICE/Xtransint.h
index dfe89baf8..d557cc9ee 100644
--- a/dcop/KDE-ICE/Xtransint.h
+++ b/dcop/KDE-ICE/Xtransint.h
@@ -108,7 +108,7 @@ extern int  errno;		/* Internal system error number. */
  * to avoid a race condition. JKJ (6/5/97)
  */
 
-#if (defined(_POSIX_SOURCE) && !defined(AIXV3) && !defined(__QNX__)) || defined(hpux) || defined(USG) || defined(SVR4) || defined(SCO)
+#if (defined(_POSIX_SOURCE) && !defined(AIXV3) && !defined(__QNX__)) || defined(USG) || defined(SVR4) || defined(SCO)
 #ifndef NEED_UTSNAME
 #define NEED_UTSNAME
 #endif
diff --git a/dcop/KDE-ICE/Xtranssock.c b/dcop/KDE-ICE/Xtranssock.c
index 62e0ee0cd..5bfbe3401 100644
--- a/dcop/KDE-ICE/Xtranssock.c
+++ b/dcop/KDE-ICE/Xtranssock.c
@@ -79,9 +79,9 @@ from The Open Group.
 #include <sys/stat.h>
 #endif
 
-#if defined(hpux) || defined(__EMX__)
+#if defined(__EMX__)
 #define NO_TCP_H
-#endif /* hpux */
+#endif
 #ifdef MOTOROLA
 #ifdef SYSV
 #define NO_TCP_H
@@ -208,37 +208,6 @@ static Sockettrans2dev Sockettrans2devtab[] = {
 
 #ifdef UNIXCONN
 
-#ifdef hpux
-
-#if defined(X11_t)
-#define UNIX_PATH "/usr/spool/sockets/X11/"
-#define UNIX_DIR "/usr/spool/sockets/X11"
-#define OLD_UNIX_PATH "/tmp/.X11-unix/X"
-#endif /* X11_t */
-#if defined(XIM_t)
-#define UNIX_PATH "/usr/spool/sockets/XIM/"
-#define UNIX_DIR "/usr/spool/sockets/XIM"
-#define OLD_UNIX_PATH "/tmp/.XIM-unix/XIM"
-#endif /* XIM_t */
-#if defined(FS_t) || defined(FONT_t)
-#define UNIX_PATH "/usr/spool/sockets/fontserv/"
-#define UNIX_DIR "/usr/spool/sockets/fontserv"
-#endif /* FS_t || FONT_t */
-#if defined(ICE_t)
-#define UNIX_PATH "/usr/spool/sockets/ICE/"
-#define UNIX_DIR "/usr/spool/sockets/ICE"
-#endif /* ICE_t */
-#if defined(TEST_t)
-#define UNIX_PATH "/usr/spool/sockets/xtrans_test/"
-#define UNIX_DIR "/usr/spool/sockets/xtrans_test"
-#endif
-#if defined(LBXPROXY_t)
-#define UNIX_PATH "/usr/spool/sockets/X11/"
-#define UNIX_DIR  "/usr/spool/sockets/X11"
-#endif
-
-#else /* !hpux */
-
 #if defined(X11_t)
 #define UNIX_PATH "/tmp/.X11-unix/X"
 #define UNIX_DIR "/tmp/.X11-unix"
@@ -264,8 +233,6 @@ static Sockettrans2dev Sockettrans2devtab[] = {
 #define UNIX_DIR  "/tmp/.X11-unix"
 #endif
 
-#endif /* hpux */
-
 #endif /* UNIXCONN */
 
 #define PORTBUFSIZE	32
@@ -967,7 +934,7 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port)
     /*
      * Now that the listener is esablished, create the addr info for
      * this connection. getpeername() doesn't work for UNIX Domain Sockets
-     * on some systems (hpux at least), so we will just do it manually, instead
+     * on some systems, so we will just do it manually, instead
      * of calling something like TRANS(SocketUNIXGetAddr).
      */
 
@@ -1535,12 +1502,6 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
     struct sockaddr_un	sockname;
     int			namelen;
 
-#if defined(hpux) && defined(X11_t)
-    struct sockaddr_un	old_sockname;
-    int			old_namelen;
-#endif
-
-
     PRMSG (2,"[Xtranssock] SocketUNIXConnect(%d,%s,%s)\n", ciptr->fd, host, port);
 
     /*
@@ -1587,20 +1548,6 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
     sockname.sun_len = namelen;
 #endif
 
-#if defined(hpux) && defined(X11_t)
-    /*
-     * This is gross, but it was in Xlib
-     */
-    old_sockname.sun_family = AF_UNIX;
-    if (set_sun_path(port, OLD_UNIX_PATH, old_sockname.sun_path) != 0) {
-	PRMSG (1, "[Xtranssock] SocketUNIXConnect: path too long\n", 0, 0, 0);
-	return TRANS_CONNECT_FAILED;
-    }
-    old_namelen = strlen (old_sockname.sun_path) +
-	sizeof (old_sockname.sun_family);
-#endif
-
-
     /*
      * Do the connect()
      */
@@ -1610,18 +1557,6 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
 	int olderrno = errno;
 	int connected = 0;
 
-#if defined(hpux) && defined(X11_t)
-	if (olderrno == ENOENT)
-	{
-	    if (connect (ciptr->fd,
-		(struct sockaddr *) &old_sockname, old_namelen) >= 0)
-	    {
-		connected = 1;
-	    }
-	    else
-		olderrno = errno;
-	}
-#endif
 	if (!connected)
 	{
 	    errno = olderrno;
diff --git a/dcop/dcopidl/scanner.cpp b/dcop/dcopidl/scanner.cpp
index 4ff8d1ac3..be0cb6c4d 100644
--- a/dcop/dcopidl/scanner.cpp
+++ b/dcop/dcopidl/scanner.cpp
@@ -975,8 +975,8 @@ static double ascii_to_longdouble (const char *s)
    * this is only an approximation and will probably break fixed<>
    * parameter calculation on systems where
    * sizeof(double) < sizeof(long double). but fortunately all
-   * systems where scanf("%Lf") is known to be broken (Linux/Alpha
-   * and HPUX) have sizeof(double) == sizeof(long double).
+   * systems where scanf("%Lf") is known to be broken (Linux/Alpha)
+   * have sizeof(double) == sizeof(long double).
    */
   d = strtod (s, NULL);
 #endif
diff --git a/dcop/dcopidl/scanner.ll b/dcop/dcopidl/scanner.ll
index 710cbc3f4..ec6c48f32 100644
--- a/dcop/dcopidl/scanner.ll
+++ b/dcop/dcopidl/scanner.ll
@@ -64,8 +64,8 @@ static double ascii_to_longdouble (const char *s)
    * this is only an approximation and will probably break fixed<>
    * parameter calculation on systems where
    * sizeof(double) < sizeof(long double). but fortunately all
-   * systems where scanf("%Lf") is known to be broken (Linux/Alpha
-   * and HPUX) have sizeof(double) == sizeof(long double).
+   * systems where scanf("%Lf") is known to be broken (Linux/Alpha)
+   * have sizeof(double) == sizeof(long double).
    */
   d = strtod (s, NULL);
 #endif
diff --git a/tdecore/kpty.cpp b/tdecore/kpty.cpp
index d801b7c9a..cb3cc6b9a 100644
--- a/tdecore/kpty.cpp
+++ b/tdecore/kpty.cpp
@@ -79,8 +79,6 @@
 #endif
 
 #ifdef HAVE_TERMIOS_H
-/* for HP-UX (some versions) the extern C is needed, and for other
-   platforms it doesn't hurt */
 extern "C" {
 # include <termios.h>
 }
@@ -111,11 +109,6 @@ extern "C" {
 # error
 #endif
 
-#if defined (_HPUX_SOURCE)
-# define _TERMIOS_INCLUDED
-# include <bsdtty.h>
-#endif
-
 #if defined(HAVE_PTY_H)
 # include <pty.h>
 #endif
@@ -273,7 +266,7 @@ bool KPty::_attachPty(int pty_master)
 #endif
 
     // set xon/xoff & control keystrokes
-  // without the '::' some version of HP-UX thinks, this declares
+  // without the '::' some old system thinks, this declares
   // the struct in this class, in this method, and fails to find
   // the correct tc[gs]etattr
   struct ::termios ttmode;
@@ -537,7 +530,7 @@ void KPty::setXonXoff(bool useXonXoff)
 {
   d->xonXoff = useXonXoff;
   if (d->masterFd >= 0) {
-    // without the '::' some version of HP-UX thinks, this declares
+    // without the '::' some old system thinks, this declares
     // the struct in this class, in this method, and fails to find
     // the correct tc[gs]etattr
     struct ::termios ttmode;
@@ -558,7 +551,7 @@ void KPty::setUtf8Mode(bool useUtf8)
   d->utf8 = useUtf8;
 #ifdef IUTF8
   if (d->masterFd >= 0) {
-    // without the '::' some version of HP-UX thinks, this declares
+    // without the '::' some old system thinks, this declares
     // the struct in this class, in this method, and fails to find
     // the correct tc[gs]etattr
     struct ::termios ttmode;
diff --git a/tdecore/netsupp.cpp b/tdecore/netsupp.cpp
index 0ea43178d..25f73d0c5 100644
--- a/tdecore/netsupp.cpp
+++ b/tdecore/netsupp.cpp
@@ -45,10 +45,6 @@
 #undef CLOBBER_IN6
 #include "netsupp.h"
 
-#if defined(__hpux) || defined(_HPUX_SOURCE)
-extern int h_errno;
-#endif
-
 #include <tdemacros.h>
 
 #if !defined(kde_sockaddr_in6)
diff --git a/tdeinit/setproctitle.h b/tdeinit/setproctitle.h
index c50b2d97d..c748d1eea 100644
--- a/tdeinit/setproctitle.h
+++ b/tdeinit/setproctitle.h
@@ -17,10 +17,6 @@
 #ifndef _SETPROCTITLE_H_
 #define _SETPROCTITLE_H_
 
-#ifdef __hpux
-# define SPT_TYPE       SPT_PSTAT
-#endif
-
 #ifdef _AIX3
 # define SPT_PADCHAR    '\0'    /* pad process title with nulls */
 #endif
diff --git a/tdeio/kssl/kopenssl.cpp b/tdeio/kssl/kopenssl.cpp
index 96e4473a2..0c23f02f6 100644
--- a/tdeio/kssl/kopenssl.cpp
+++ b/tdeio/kssl/kopenssl.cpp
@@ -370,9 +370,7 @@ TDEConfig *cfg;
 
 // FIXME: #define here for the various OS types to optimize
    libnamess
-	     #ifdef hpux
-	     << "libssl.sl"
-	     #elif defined(_AIX)
+	     #if defined(_AIX)
 	     << "libssl.a(libssl.so.0)"
 	     #elif defined(__APPLE__)
 	     << "libssl.dylib"
@@ -391,9 +389,7 @@ TDEConfig *cfg;
 	     ;
 
    libnamesc
-	     #ifdef hpux
-	     << "libcrypto.sl"
-	     #elif defined(_AIX)
+	     #if defined(_AIX)
 	     << "libcrypto.a(libcrypto.so.0)"
 	     #elif defined(__APPLE__)
 	     << "libcrypto.dylib"
diff --git a/tdeio/tdeio/kurlcompletion.cpp b/tdeio/tdeio/kurlcompletion.cpp
index 2ea5d03fc..4785ff930 100644
--- a/tdeio/tdeio/kurlcompletion.cpp
+++ b/tdeio/tdeio/kurlcompletion.cpp
@@ -223,7 +223,7 @@ void DirectoryListThread::run()
 
 		// Loop through all directory entries
 		// Solaris and IRIX dirent structures do not allocate space for d_name. On
-		// systems that do (HP-UX, Linux), we overallocate space but that's ok.
+		// systems that do (Linux), we overallocate space but that's ok.
 #ifndef HAVE_READDIR_R
 		struct dirent *dirEntry = 0;
 		while ( !terminationRequested() &&
diff --git a/tdeio/tdeio/tdefilemetainfo.h b/tdeio/tdeio/tdefilemetainfo.h
index e0371c7dd..ef9eb154f 100644
--- a/tdeio/tdeio/tdefilemetainfo.h
+++ b/tdeio/tdeio/tdefilemetainfo.h
@@ -20,18 +20,12 @@
 #ifndef TDEFILEMETAINFO_H
 #define TDEFILEMETAINFO_H
 
-/* Hack for HPUX: Namespace pollution
-   m_unit is a define in <sys/sysmacros.h> */
-#define m_unit outouftheway_m_unit
-
 #include <tqdict.h>
 #include <tqvariant.h>
 #include <tqobject.h>
 #include <tqstring.h>
 #include <kurl.h>
 
-#undef m_unit
-
 class TQValidator;
 class KFilePlugin;
 class KFileMetaInfoGroup;
diff --git a/tdeprint/cups/cupsdconf2/cupsd.conf.template b/tdeprint/cups/cupsdconf2/cupsd.conf.template
index e1cd0d287..55aa24f3d 100644
--- a/tdeprint/cups/cupsdconf2/cupsd.conf.template
+++ b/tdeprint/cups/cupsdconf2/cupsd.conf.template
@@ -447,9 +447,6 @@ $$
 # Specifies a broadcast address to be used.  By
 # default browsing information is broadcast to all active interfaces.</p>
 # <p>
-# Note: HP-UX 10.20 and earlier do not properly handle broadcast unless
-# you have a Class A, B, C, or D netmask (i.e. no CIDR support).</p>
-# <p>
 # <i>ex</i>: x.y.z.255, x.y.255.255</p>
 $$
 #BrowseAddress x.y.z.255
diff --git a/tdeprint/fooparser.cpp b/tdeprint/fooparser.cpp
index 55e68532b..23dd22dd2 100644
--- a/tdeprint/fooparser.cpp
+++ b/tdeprint/fooparser.cpp
@@ -240,13 +240,6 @@ static const short yycheck[] = {     4,
  #pragma alloca
 #define YYSTACK_USE_ALLOCA
 #else /* not MSDOS or _AIX */
-#if 0
-#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
-		 and on HPUX 10.  Eventually we can turn this on.  */
-#define YYSTACK_USE_ALLOCA
-#define alloca __builtin_alloca
-#endif /* __hpux */
-#endif
 #endif /* not _AIX */
 #endif /* not MSDOS */
 #endif /* not sparc */
diff --git a/tdeprint/lpdunix/kmlpdunixmanager.cpp b/tdeprint/lpdunix/kmlpdunixmanager.cpp
index 6d7e5e9ab..96631336c 100644
--- a/tdeprint/lpdunix/kmlpdunixmanager.cpp
+++ b/tdeprint/lpdunix/kmlpdunixmanager.cpp
@@ -323,7 +323,7 @@ void KMLpdUnixManager::parseEtcLpPrinters()
 	}
 }
 
-// "/etc/lp/member/" directory parsing (HP-UX)
+// "/etc/lp/member/" directory parsing
 void KMLpdUnixManager::parseEtcLpMember()
 {
 	TQDir	d("/etc/lp/member");
diff --git a/tdersync/tdersync.cpp b/tdersync/tdersync.cpp
index e83f22088..a88ad3032 100644
--- a/tdersync/tdersync.cpp
+++ b/tdersync/tdersync.cpp
@@ -204,7 +204,7 @@ TDE_EXPORT bool KRsync::syncUnidirectional(TQString synccommand, TQString syncfl
 #endif
 
         int pgrp = getpid();
-#if defined( _AIX) || defined( __hpux)
+#if defined( _AIX)
         tcsetpgrp(0, pgrp);
 #else
         ioctl(0, TIOCSPGRP, (char *)&pgrp);
@@ -343,7 +343,7 @@ TDE_EXPORT bool KRsync::syncBidirectional(TQString synccommand, TQString syncfla
 #endif
 
         int pgrp = getpid();
-#if defined( _AIX) || defined( __hpux)
+#if defined( _AIX)
         tcsetpgrp(0, pgrp);
 #else
         ioctl(0, TIOCSPGRP, (char *)&pgrp);
-- 
cgit v1.2.3

