diff options
author | Eli Schwartz <eschwartz93@gmail.com> | 2024-03-19 23:13:48 -0400 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2024-03-20 06:17:01 +0000 |
commit | 2034f4dc27f765d1d8ab8eddaf4142a3286dfa29 (patch) | |
tree | 9aff3cde99ea1e648e7498707ffe85a58d11ad80 /media-libs/nas | |
parent | net-analyzer/tcptrace: fix Modern C porting (diff) | |
download | gentoo-2034f4dc27f765d1d8ab8eddaf4142a3286dfa29.tar.gz gentoo-2034f4dc27f765d1d8ab8eddaf4142a3286dfa29.tar.bz2 gentoo-2034f4dc27f765d1d8ab8eddaf4142a3286dfa29.zip |
media-libs/nas: backport upstreamed patches to fix Modern C bugs
Closes: https://bugs.gentoo.org/873619
Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'media-libs/nas')
3 files changed, 1063 insertions, 0 deletions
diff --git a/media-libs/nas/files/nas-1.9.5-Correct-pointer-types-for-GCC-14.patch b/media-libs/nas/files/nas-1.9.5-Correct-pointer-types-for-GCC-14.patch new file mode 100644 index 000000000000..1ed7dae2d48c --- /dev/null +++ b/media-libs/nas/files/nas-1.9.5-Correct-pointer-types-for-GCC-14.patch @@ -0,0 +1,108 @@ +From cffa7bbc124f775520914a0cfb0ede619a05e07d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> +Date: Fri, 2 Feb 2024 16:05:11 +0100 +Subject: [PATCH] Correct pointer types for GCC 14 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +GCC 14 became pickier about pointer types: + +auth.c:71:26: error: initialization of ‘int (*)()’ from incompatible pointer type ‘int (*)(short unsigned int, char *)’ [-Wincompatible-pointer-types] + 71 | MitToID, MitFromID, MitRemoveCookie, + | ^~~~~~~~~~~~~~~ + +Including const correctness: + +audemo.c: In function ‘rescanCB’: +audemo.c:524:23: error: passing argument 2 of ‘XawListChange’ from incompatible pointer type [-Wincompatible-pointer-types] + 524 | makeFileList(globals->fileNames, globals->numFiles), + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | + | char ** + +This patch fixes these errors. + +Signed-off-by: Petr Písař <ppisar@redhat.com> +--- + clients/audio/audemo/audemo.c | 28 ++++++++++++++-------------- + server/os/auth.c | 2 +- + 2 files changed, 15 insertions(+), 15 deletions(-) + +diff --git a/clients/audio/audemo/audemo.c b/clients/audio/audemo/audemo.c +index 5617cf7..e77b95d 100644 +--- a/clients/audio/audemo/audemo.c ++++ b/clients/audio/audemo/audemo.c +@@ -500,11 +500,11 @@ newBucketCB(Widget w, XtPointer globalsp, XtPointer call_data) + static void + rescanCB(Widget w, XtPointer globalsp, XtPointer call_data) + { +- GlobalDataPtr globals = (GlobalDataPtr) globalsp; +- static char *noFilesString = "No files found"; +- char *dir, +- *template; +- int i; ++ GlobalDataPtr globals = (GlobalDataPtr) globalsp; ++ static const char *noFilesString = "No files found"; ++ char *dir, ++ *template; ++ int i; + + if (globals->numFiles) + { +@@ -521,7 +521,7 @@ rescanCB(Widget w, XtPointer globalsp, XtPointer call_data) + if (globals->numFiles) + { + XawListChange(globals->samples, +- makeFileList(globals->fileNames, globals->numFiles), ++ (const char **)makeFileList(globals->fileNames, globals->numFiles), + globals->numFiles, -1, True); + XtSetSensitive(globals->samples, True); + } +@@ -591,13 +591,13 @@ bucketPlayCB(Widget w, XtPointer globalsp, XtPointer call_data) + static void + bucketQueryCB(Widget w, XtPointer globalsp, XtPointer call_data) + { +- GlobalDataPtr globals = (GlobalDataPtr) globalsp; ++ GlobalDataPtr globals = (GlobalDataPtr) globalsp; + BucketDialogDataPtr buf = &globals->buf; +- char tmp[200], +- access[4], +- desc[COMMENT_LEN]; +- int i; +- static char *noBucketString = "No buckets"; ++ char tmp[200], ++ access[4], ++ desc[COMMENT_LEN]; ++ int i; ++ static const char *noBucketString = "No buckets"; + + if (buf->numBuckets) + { +@@ -652,8 +652,8 @@ bucketQueryCB(Widget w, XtPointer globalsp, XtPointer call_data) + + if (buf->numBuckets) + { +- XawListChange(buf->bucketList, buf->bucketText, buf->numBuckets, -1, +- True); ++ XawListChange(buf->bucketList, (const char **)buf->bucketText, ++ buf->numBuckets, -1, True); + XtSetSensitive(buf->bucketList, True); + } + else +diff --git a/server/os/auth.c b/server/os/auth.c +index a80a257..9488db7 100644 +--- a/server/os/auth.c ++++ b/server/os/auth.c +@@ -55,7 +55,7 @@ struct protocol { + int (*Reset) (); /* delete all authorization data entries */ + AuID(*ToID) (); /* convert cookie to ID */ + int (*FromID) (); /* convert ID to cookie */ +- int (*Remove) (); /* remove a specific cookie */ ++ int (*Remove) (unsigned short, char *); /* remove a specific cookie */ + }; + + extern int MitAddCookie(); +-- +2.43.0 + diff --git a/media-libs/nas/files/nas-1.9.5-No-implicit-ints-and-function-declarations.patch b/media-libs/nas/files/nas-1.9.5-No-implicit-ints-and-function-declarations.patch new file mode 100644 index 000000000000..a3a7e50efdec --- /dev/null +++ b/media-libs/nas/files/nas-1.9.5-No-implicit-ints-and-function-declarations.patch @@ -0,0 +1,834 @@ +From 0e08ed6753a547637a39ede05a006d9b730647df Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> +Date: Tue, 22 Nov 2022 13:11:26 +0100 +Subject: [PATCH] No implicit ints and function declarations +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +GCC 13 or 14 is going to remove some old and by C99 standard obsolete +features, like implicit int types and implicit function declararations, +from an implicit gnu18 compilator standard. The compiler will report +an error instead: + +conftest.c:62:1: error: type defaults to 'int' in declaration of 'main' + 62 | main() + | ^~~~ +conftest.c:65:3: error: implicit declaration of function 'exit' + 65 | exit(0); + | ^~~~ + +This patch adjusts the code to remain compilable. For some functions, +it fixes their return type from int to void. Few functions which +apparantly are internal to a compilatation unit were made static. +_AuSendClientPrefix() was declared in a public header. + +Tested with an instrumented GCC 13.0.1. + +<https://fedoraproject.org/wiki/Changes/PortingToModernC> + +Signed-off-by: Petr Písař <ppisar@redhat.com> +--- + clients/audio/auctl/execute.c | 1 + + clients/audio/auplay/auplay.c | 1 + + clients/audio/examples/playFile.c | 1 + + config/configure.ac | 5 +- + config/filelist | 3 ++ + lib/audio/Alibint.h | 8 ++++ + lib/audio/ConnSvr.c | 3 ++ + server/dda/voxware/auvoxware.c | 3 +- + server/dda/voxware/config.c | 2 + + server/dia/au.h | 2 + + server/dia/gram.y | 1 + + server/include/access.h | 36 ++++++++++++++ + server/include/auth.h | 27 +++++++++++ + server/include/dix.h | 6 ++- + server/include/io.h | 29 ++++++++++++ + server/include/os.h | 2 + + server/os/access.c | 79 +++++++++++++++++-------------- + server/os/auth.c | 11 ++++- + server/os/connection.c | 23 +++++++-- + server/os/daemon.c | 4 ++ + server/os/io.c | 3 +- + server/os/mitauth.c | 2 + + server/os/osdep.h | 5 ++ + 23 files changed, 211 insertions(+), 46 deletions(-) + create mode 100644 server/include/access.h + create mode 100644 server/include/auth.h + create mode 100644 server/include/io.h + +diff --git a/clients/audio/auctl/execute.c b/clients/audio/auctl/execute.c +index 12f7c05..fd7a937 100644 +--- a/clients/audio/auctl/execute.c ++++ b/clients/audio/auctl/execute.c +@@ -22,6 +22,7 @@ + * $NCDId: @(#)execute.c,v 1.7 1994/04/07 18:10:33 greg Exp $ + */ + ++#include <stdlib.h> + #include "auctl.h" + + static int _execute_set PROTO((AuServer *, int, char **)); +diff --git a/clients/audio/auplay/auplay.c b/clients/audio/auplay/auplay.c +index 4037a64..c9d880e 100644 +--- a/clients/audio/auplay/auplay.c ++++ b/clients/audio/auplay/auplay.c +@@ -146,6 +146,7 @@ do_file(char *fname) + fprintf(stderr, "Couldn't play file \"%s\"\n", fname); + } + ++int + main(int argc, char **argv) + { + int i, +diff --git a/clients/audio/examples/playFile.c b/clients/audio/examples/playFile.c +index 646077e..e8828a8 100644 +--- a/clients/audio/examples/playFile.c ++++ b/clients/audio/examples/playFile.c +@@ -13,6 +13,7 @@ + #include <audio/audiolib.h> + #include <audio/soundlib.h> + ++int + main(int argc, char **argv) + { + char *file = argv[1]; +diff --git a/config/configure.ac b/config/configure.ac +index d99bedb..e57c27e 100644 +--- a/config/configure.ac ++++ b/config/configure.ac +@@ -65,11 +65,12 @@ dnl check for sys_errlist decl + + AC_MSG_CHECKING(for sys_errlist declaration) + AC_RUN_IFELSE([AC_LANG_SOURCE([[ ++#include <stdlib.h> + #include <sys/types.h> + #include <stdio.h> +- + #include <errno.h> +-main() ++int ++main(void) + { + char *s = sys_errlist[0]; + exit(0); +diff --git a/config/filelist b/config/filelist +index 9e89dc5..ed1149f 100644 +--- a/config/filelist ++++ b/config/filelist +@@ -601,9 +601,12 @@ + ./server/dia/swapreq.c + ./server/dia/tables.c + ./server/dia ++./server/include/access.h ++./server/include/auth.h + ./server/include/site.h + ./server/include/dix.h + ./server/include/dixstruct.h ++./server/include/io.h + ./server/include/misc.h + ./server/include/opaque.h + ./server/include/os.h +diff --git a/lib/audio/Alibint.h b/lib/audio/Alibint.h +index ce554c8..254a37c 100644 +--- a/lib/audio/Alibint.h ++++ b/lib/audio/Alibint.h +@@ -683,6 +683,14 @@ _AuDisconnectServer( + int /* server */ + ); + ++extern AuBool ++_AuSendClientPrefix ( ++ AuServer *aud, ++ auConnClientPrefix *client, /* contains count for auth_* */ ++ char *auth_proto, ++ char *auth_string /* NOT null-terminated */ ++); ++ + void + _AuFreeServerStructure( + AuServer * /* aud */ +diff --git a/lib/audio/ConnSvr.c b/lib/audio/ConnSvr.c +index e71bfee..4ea73b1 100644 +--- a/lib/audio/ConnSvr.c ++++ b/lib/audio/ConnSvr.c +@@ -75,6 +75,9 @@ + # endif + # include <sys/stropts.h> + #endif ++#ifdef TCPCONN ++#include <arpa/inet.h> /* for inet_addr() */ ++#endif + + #ifdef STREAMSCONN + #define select _AuSelect +diff --git a/server/dda/voxware/auvoxware.c b/server/dda/voxware/auvoxware.c +index 391514a..851db18 100644 +--- a/server/dda/voxware/auvoxware.c ++++ b/server/dda/voxware/auvoxware.c +@@ -133,6 +133,7 @@ PERFORMANCE OF THIS SOFTWARE. + + #include <stdio.h> + #include <stdlib.h> ++#include <unistd.h> + #ifndef SVR4 + #include <getopt.h> + #endif +@@ -168,6 +169,7 @@ static int debug_msg_indentation = 0; + #include "dixstruct.h" /* for RESTYPE */ + #include "os.h" /* for xalloc/xfree and NULL */ + #include <fcntl.h> ++#include <sys/ioctl.h> + #include <sys/time.h> + #include <sys/param.h> + #include <assert.h> +@@ -186,7 +188,6 @@ static int debug_msg_indentation = 0; + # include <machine/pcaudioio.h> + #else + # ifdef __NetBSD__ +-# include <sys/ioctl.h> + # include <soundcard.h> + # else + # include <sys/soundcard.h> +diff --git a/server/dda/voxware/config.c b/server/dda/voxware/config.c +index 40aae46..a02e2f5 100644 +--- a/server/dda/voxware/config.c ++++ b/server/dda/voxware/config.c +@@ -5,6 +5,8 @@ + */ + + #include <fcntl.h> ++#include <string.h> ++#include "os.h" + #include "nasconf.h" + #include "config.h" + #include "aulog.h" +diff --git a/server/dia/au.h b/server/dia/au.h +index 47dbf8d..b1de3d4 100644 +--- a/server/dia/au.h ++++ b/server/dia/au.h +@@ -409,6 +409,8 @@ _pFunc AuCallbacks[AuMaxCB]; + (*AuCallbacks[_n]) _args + + #ifndef WAKEUP_SERVER ++#include <signal.h> ++#include <unistd.h> + #define WAKEUP_SERVER() kill(getpid(), SIGUSR1) + #endif /* !WAKEUP_SERVER */ + +diff --git a/server/dia/gram.y b/server/dia/gram.y +index 50b40c7..4757de3 100644 +--- a/server/dia/gram.y ++++ b/server/dia/gram.y +@@ -16,6 +16,7 @@ + static char *ptr; + static void RemoveDQuote(char *str); + static long parsebool(char *str); ++extern int yylex (void); + extern int yylineno; + void yyerror(char *s); + +diff --git a/server/include/access.h b/server/include/access.h +new file mode 100644 +index 0000000..35a1496 +--- /dev/null ++++ b/server/include/access.h +@@ -0,0 +1,36 @@ ++/*********************************************************** ++Copyright 2022 by Petr Pisar. ++ ++ All Rights Reserved ++ ++Permission to use, copy, modify, and distribute this software and its ++documentation for any purpose and without fee is hereby granted, ++provided that the above copyright notice appear in all copies and that ++both that copyright notice and this permission notice appear in ++supporting documentation, and that the names of Digital or MIT not be ++used in advertising or publicity pertaining to distribution of the ++software without specific, written prior permission. ++ ++DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ++ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL ++DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ++ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, ++WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ++ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS ++SOFTWARE. ++ ++******************************************************************/ ++ ++#ifndef ACCESS_H ++#define ACCESS_H ++int DefineSelf(int fd); ++void EnableLocalHost(void); ++void ResetHosts(char *display); ++ ++#ifdef AMOEBA ++int InvalidHost(ipaddr_t *saddr, int len); ++#else ++int InvalidHost(struct sockaddr *saddr, int len); ++#endif ++ ++#endif +diff --git a/server/include/auth.h b/server/include/auth.h +new file mode 100644 +index 0000000..24c4ce5 +--- /dev/null ++++ b/server/include/auth.h +@@ -0,0 +1,27 @@ ++/*********************************************************** ++Copyright 2022 by Petr Pisar. ++ ++ All Rights Reserved ++ ++Permission to use, copy, modify, and distribute this software and its ++documentation for any purpose and without fee is hereby granted, ++provided that the above copyright notice appear in all copies and that ++both that copyright notice and this permission notice appear in ++supporting documentation, and that the names of Digital or MIT not be ++used in advertising or publicity pertaining to distribution of the ++software without specific, written prior permission. ++ ++DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ++ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL ++DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ++ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, ++WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ++ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS ++SOFTWARE. ++ ++******************************************************************/ ++ ++#ifndef AUTH_H ++#define AUTH_H ++void ResetAuthorization(void); ++#endif +diff --git a/server/include/dix.h b/server/include/dix.h +index 27e85a4..bceddf6 100644 +--- a/server/include/dix.h ++++ b/server/include/dix.h +@@ -26,6 +26,8 @@ SOFTWARE. + #ifndef DIX_H + #define DIX_H + ++#include "misc.h" /* for pointer typedef */ ++ + #define EARLIER -1 + #define SAMETIME 0 + #define LATER 1 +@@ -84,6 +86,8 @@ extern ClientPtr serverClient; + extern int currentMaxClients; + extern long *checkForInput[2]; + +-extern void NoopDDA(pointer, AuID); ++extern void NoopDDA(pointer value, AuID id); ++extern void ProcessWorkQueue(void); ++extern Bool QueueWorkProc(Bool(*function)(void), ClientPtr client, pointer closure); + + #endif /* DIX_H */ +diff --git a/server/include/io.h b/server/include/io.h +new file mode 100644 +index 0000000..16524c2 +--- /dev/null ++++ b/server/include/io.h +@@ -0,0 +1,29 @@ ++/*********************************************************** ++Copyright 2022 by Petr Pisar. ++ ++ All Rights Reserved ++ ++Permission to use, copy, modify, and distribute this software and its ++documentation for any purpose and without fee is hereby granted, ++provided that the above copyright notice appear in all copies and that ++both that copyright notice and this permission notice appear in ++supporting documentation, and that the names of Digital or MIT not be ++used in advertising or publicity pertaining to distribution of the ++software without specific, written prior permission. ++ ++DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ++ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL ++DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ++ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, ++WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ++ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS ++SOFTWARE. ++ ++******************************************************************/ ++ ++#ifndef IO_H ++#define IO_H ++#include "dix.h" ++#include "osdep.h" ++int FlushClient(ClientPtr who, OsCommPtr oc, char *extraBuf, int extraCount); ++#endif +diff --git a/server/include/os.h b/server/include/os.h +index f7084d5..e9e0e68 100644 +--- a/server/include/os.h ++++ b/server/include/os.h +@@ -140,6 +140,8 @@ void ProcessCommandLine(); + char *FindConfigFile(); + void FlushAllOutput(); + void FlushIfCriticalOutputPending(); ++void OsInitAllocator(void); ++void AuditF(); + #ifndef CAHILL_MALLOC + void Xfree(pointer ptr); + void *Xalloc(unsigned long size); +diff --git a/server/os/access.c b/server/os/access.c +index 6d10fda..06f1aad 100644 +--- a/server/os/access.c ++++ b/server/os/access.c +@@ -54,6 +54,7 @@ SOFTWARE. + #include "misc.h" + #include "site.h" + #include <errno.h> ++#include <stdio.h> + #include <sys/types.h> + #include <sys/socket.h> + #include <sys/ioctl.h> +@@ -69,7 +70,7 @@ SOFTWARE. + #include <net/gen/tcp.h> + #include <net/gen/tcp_io.h> + #endif /* _MINIX */ +-#endif /* TCPCONN || ISC */ ++#endif /* TCPCONN || ISC || USL */ + #ifdef DNETCONN + #include <netdnet/dn.h> + #include <netdnet/dnetdb.h> +@@ -85,23 +86,23 @@ SOFTWARE. + # include <net/if.h> + # endif + #else +-#if defined(SVR4) || defined(SYSV386) || defined(USE_FALLBACK_DEFINESELF) +-# include <sys/utsname.h> +-#endif +-#if defined(SYSV) && defined(SYSV386) +-# include <sys/stream.h> +-# ifdef ISC +-# include <sys/stropts.h> +-# include <sys/sioctl.h> +-# endif /* ISC */ +-#endif +-#ifdef ESIX +-# include <lan/if.h> +-#else +-#if !defined(AMOEBA) || !defined(_MINIX) +-# include <net/if.h> +-#endif +-#endif ++# if defined(SVR4) || defined(SYSV386) || defined(USE_FALLBACK_DEFINESELF) ++# include <sys/utsname.h> ++# endif ++# if defined(SYSV) && defined(SYSV386) ++# include <sys/stream.h> ++# ifdef ISC ++# include <sys/stropts.h> ++# include <sys/sioctl.h> ++# endif /* ISC */ ++# endif ++# ifdef ESIX ++# include <lan/if.h> ++# else ++# if !defined(AMOEBA) || !defined(_MINIX) ++# include <net/if.h> ++# endif ++# endif + #endif /* hpux */ + + #ifdef SVR4 +@@ -110,18 +111,18 @@ SOFTWARE. + #endif + + #ifdef ESIX +-#include <net/netdb.h> +-#else +-#ifdef AMOEBA +-#include <server/ip/gen/netdb.h> ++# include <net/netdb.h> + #else +-#ifndef _MINIX +-#include <netdb.h> +-#endif +-#endif /* AMOEBA */ ++# ifdef AMOEBA ++# include <server/ip/gen/netdb.h> ++# else ++# ifndef _MINIX ++# include <netdb.h> ++# endif ++# endif /* AMOEBA */ + #endif /* ESIX */ ++ + #undef NULL +-#include <stdio.h> + #include "dixstruct.h" + #include "osdep.h" + +@@ -208,6 +209,15 @@ static int AccessEnabled = DEFAULT_ACCESS_CONTROL; + static int LocalHostEnabled = FALSE; + static int UsingXdmcp = FALSE; + ++static void ++AddLocalHosts(void) ++{ ++ HOST *self; ++ ++ for (self = selfhosts; self; self = self->next) ++ (void) NewHost(self->family, self->addr, self->len); ++} ++ + /* + * called when authorization is not enabled to add the + * local host to the access list +@@ -244,9 +254,10 @@ AccessUsingXdmcp(void) + */ + /* SVR4, ISC, linux use this if SIOCGIFCONF fails */ + #ifdef USE_FALLBACK_DEFINESELF +-static ++static int + FallbackDefineSelf(fd) + #else ++int + DefineSelf(fd) + #endif + int fd; +@@ -315,6 +326,7 @@ int fd; + /* Define this host for access control. Find all the hosts the OS knows about + * for this fd and add them to the selfhosts list. + */ ++int + DefineSelf(fd) + int fd; + { +@@ -398,6 +410,7 @@ int fd; + #else /* _MINIX */ + /* Define this host for access control. + */ ++int + DefineSelf(fd) + int fd; + { +@@ -435,15 +448,8 @@ int fd; + #endif /* AMOEBA */ + + +-AddLocalHosts() +-{ +- HOST *self; +- +- for (self = selfhosts; self; self = self->next) +- (void) NewHost(self->family, self->addr, self->len); +-} +- + /* Reset access control list to initial hosts */ ++void + ResetHosts(display) + char *display; + { +@@ -807,6 +813,7 @@ CheckAddr(int family, pointer pAddr, unsigned length) + /* Check if a host is not in the access control list. + * Returns 1 if host is invalid, 0 if we've found it. */ + ++int + InvalidHost(saddr, len) + #ifdef AMOEBA + ipaddr_t *saddr; +diff --git a/server/os/auth.c b/server/os/auth.c +index 2aef275..a80a257 100644 +--- a/server/os/auth.c ++++ b/server/os/auth.c +@@ -45,6 +45,7 @@ + # include <audio/audio.h> + # include <X11/Xauth.h> + # include "misc.h" ++# include "access.h" + + struct protocol { + unsigned short name_length; +@@ -61,7 +62,8 @@ extern int MitAddCookie(); + extern AuID MitCheckCookie(); + extern int MitResetCookie(); + extern AuID MitToID(); +-extern int MitFromID(), MitRemoveCookie(); ++extern int MitFromID(AuID id, unsigned short *data_lenp, char **datap); ++extern int MitRemoveCookie(unsigned short data_length, char *data); + + static struct protocol protocols[] = { + {(unsigned short) 18, "MIT-MAGIC-COOKIE-1", +@@ -83,6 +85,7 @@ static char *authorization_file = (char *) NULL; + static int AuthorizationIndex = 0; + static Bool ShouldLoadAuth = TRUE; + ++void + InitAuthorization(file_name) + char *file_name; + { +@@ -148,7 +151,8 @@ char *data; + return (AuID) ~ 0L; + } + +-ResetAuthorization() ++void ++ResetAuthorization(void) + { + int i; + +@@ -175,6 +179,7 @@ char *data; + return (AuID) ~ 0L; + } + ++int + AuthorizationFromID(id, name_lenp, namep, data_lenp, datap) + AuID id; + unsigned short *name_lenp; +@@ -194,6 +199,7 @@ char **datap; + return 0; + } + ++int + RemoveAuthorization(name_length, name, data_length, data) + unsigned short name_length; + char *name; +@@ -211,6 +217,7 @@ char *data; + return 0; + } + ++int + AddAuthorization(name_length, name, data_length, data) + unsigned short name_length; + char *name; +diff --git a/server/os/connection.c b/server/os/connection.c +index f87c9f0..b7049bc 100644 +--- a/server/os/connection.c ++++ b/server/os/connection.c +@@ -154,6 +154,9 @@ static int unixDomainConnection = -1; + #if !defined(AMOEBA) && !defined(_MINIX) + #include <sys/uio.h> + #endif ++#include "access.h" ++#include "auth.h" ++#include "io.h" + #include "os.h" + #include "osdep.h" + #include "opaque.h" +@@ -316,7 +319,7 @@ extern ClientPtr NextAvailableClient(); + extern SIGVAL AutoResetServer(); + extern SIGVAL GiveUp(); + extern AuID CheckAuthorization(); +-#ifndef AMOEBA ++#ifndef _MINIX + static void CloseDownFileDescriptor(), ErrorConnMax(); + #endif + extern void FreeOsBuffers(), ResetOsBuffers(); +@@ -1733,7 +1736,7 @@ ClientPtr client; + AuditF("client %d disconnected\n", client->index); + } + +- ++void + AddEnabledDevice(fd) + int fd; + { +@@ -1741,7 +1744,7 @@ int fd; + BITSET(AllSockets, fd); + } + +- ++void + RemoveEnabledDevice(fd) + int fd; + { +@@ -1759,6 +1762,7 @@ int fd; + * This routine is "undone" by ListenToAllClients() + *****************/ + ++void + OnlyListenToOneClient(client) + ClientPtr client; + { +@@ -1789,6 +1793,7 @@ ClientPtr client; + * Undoes OnlyListentToOneClient() + ****************/ + ++void + ListenToAllClients() + { + if (GrabInProgress) { +@@ -1801,6 +1806,7 @@ ListenToAllClients() + + /* make client impervious to grabs; assume only executing client calls this */ + ++void + MakeClientGrabImpervious(client) + ClientPtr client; + { +@@ -1812,6 +1818,7 @@ ClientPtr client; + + /* make client pervious to grabs; assume only executing client calls this */ + ++void + MakeClientGrabPervious(client) + ClientPtr client; + { +@@ -1974,6 +1981,7 @@ CloseDownFileDescriptor(OsCommPtr oc) + xfree(oc); + } + ++void + CloseDownConnection(client) + ClientPtr client; + { +@@ -1989,18 +1997,21 @@ ClientPtr client; + client->osPrivate = (pointer) NULL; + } + ++void + AddEnabledDevice(fd) + int fd; + { + ASIO_FD_SET(fd, ASIO_READ, &InprogressFdSet); + } + ++void + RemoveEnabledDevice(fd) + int fd; + { + ASIO_FD_CLR(fd, ASIO_READ, &InprogressFdSet); + } + ++void + OnlyListenToOneClient(client) + ClientPtr client; + { +@@ -2014,6 +2025,7 @@ ClientPtr client; + } + } + ++void + ListenToAllClients() + { + if (GrabInProgress) { +@@ -2312,6 +2324,7 @@ pointer closure; + + #define NOROOM "Maximum number of clients reached" + ++void + OnlyListenToOneClient(client) + ClientPtr client; + { +@@ -2322,6 +2335,7 @@ ClientPtr client; + grabClient = client; + } + ++void + CloseDownConnection(client) + ClientPtr client; + { +@@ -2339,18 +2353,21 @@ ClientPtr client; + client->osPrivate = (pointer) NULL; + } + ++void + ListenToAllClients() + { + grabClient = NULL; + } + + /* These two are dummies -- and are never called at run-time */ ++void + AddEnabledDevice(fd) + int fd; + { + return; + } + ++void + RemoveEnabledDevice(fd) + int fd; + { +diff --git a/server/os/daemon.c b/server/os/daemon.c +index 9a92b88..187fd9b 100644 +--- a/server/os/daemon.c ++++ b/server/os/daemon.c +@@ -36,6 +36,7 @@ from the X Consortium. + + #include <stdio.h> + #include <stdlib.h> ++#include <unistd.h> + + #include <fcntl.h> + #include <sys/types.h> +@@ -60,6 +61,9 @@ from the X Consortium. + #endif + + #include "os.h" ++#if defined(linux) || defined(CSRG_BASED) || defined(__QNXNTO__) ++#include "aulog.h" ++#endif + + void + osBecomeOrphan(void) +diff --git a/server/os/io.c b/server/os/io.c +index b607da3..8def950 100644 +--- a/server/os/io.c ++++ b/server/os/io.c +@@ -369,7 +369,7 @@ int count; + * Reset to reexecute the current request, and yield. + * + **********************/ +- ++void + ResetCurrentRequest(client) + ClientPtr client; + { +@@ -966,6 +966,7 @@ int count; + return TRUE; + } + ++void + ResetCurrentRequest(client) + ClientPtr client; + { +diff --git a/server/os/mitauth.c b/server/os/mitauth.c +index f1039b7..891bd3f 100644 +--- a/server/os/mitauth.c ++++ b/server/os/mitauth.c +@@ -119,6 +119,7 @@ char *data; + return (AuID) - 1; + } + ++int + MitFromID(id, data_lenp, datap) + AuID id; + unsigned short *data_lenp; +@@ -136,6 +137,7 @@ char **datap; + return 0; + } + ++int + MitRemoveCookie(data_length, data) + unsigned short data_length; + char *data; +diff --git a/server/os/osdep.h b/server/os/osdep.h +index 27ce620..bbbd0d3 100644 +--- a/server/os/osdep.h ++++ b/server/os/osdep.h +@@ -47,6 +47,9 @@ SOFTWARE. + + ******************************************************************/ + ++#ifndef OSDEP_H ++#define OSDEP_H ++ + #ifdef AMOEBA + #include <stddef.h> + #include <amoeba.h> +@@ -306,3 +309,5 @@ extern int nNewConns; /* # of new clients */ + + extern semaphore init_sema; /* Initialize semaphore */ + #endif /* AMOEBA */ ++ ++#endif /* ndef OSDEP_H */ +-- +2.39.1 + diff --git a/media-libs/nas/nas-1.9.5-r1.ebuild b/media-libs/nas/nas-1.9.5-r1.ebuild new file mode 100644 index 000000000000..8e1276acd78a --- /dev/null +++ b/media-libs/nas/nas-1.9.5-r1.ebuild @@ -0,0 +1,121 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit multilib multilib-minimal toolchain-funcs + +DESCRIPTION="Network Audio System" +HOMEPAGE="https://radscan.com/nas.html" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +LICENSE="HPND MIT" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86" +IUSE="doc static-libs" + +RDEPEND=" + x11-libs/libICE + x11-libs/libSM + x11-libs/libX11 + x11-libs/libXau[${MULTILIB_USEDEP}] + x11-libs/libXaw + x11-libs/libXext + x11-libs/libXmu + x11-libs/libXpm + x11-libs/libXt[${MULTILIB_USEDEP}]" +DEPEND=" + ${RDEPEND} + x11-base/xorg-proto" +BDEPEND=" + app-text/rman + app-alternatives/yacc + app-alternatives/lex + sys-devel/gcc + x11-misc/gccmakedep + riscv? ( x11-misc/xorg-cf-files ) + >=x11-misc/imake-1.0.8-r1" + +DOCS=( BUILDNOTES FAQ HISTORY README RELEASE TODO ) + +PATCHES=( + "${FILESDIR}/${PN}-1.9.2-asneeded.patch" + "${FILESDIR}/${PN}-1.9.4-libfl.patch" + # Applied upstream + "${FILESDIR}"/nas-1.9.5-No-implicit-ints-and-function-declarations.patch + "${FILESDIR}"/nas-1.9.5-Correct-pointer-types-for-GCC-14.patch +) + +src_prepare() { + default + multilib_copy_sources +} + +multilib_src_configure() { + # Need to run econf so that config.guess is updated + pushd config || die + econf + popd || die + + local cpp=($(get_abi_CHOST ${DEFAULT_ABI})-gcc $(get_abi_CFLAGS) -E) #884203 + CC="$(tc-getBUILD_CC)" LD="$(tc-getLD)" \ + IMAKECPP="${IMAKECPP:-${cpp[*]}}" \ + xmkmf -a || die +} + +multilib_src_compile() { + # EXTRA_LDOPTIONS, SHLIBGLOBALSFLAGS #336564#c2 + local emakeopts=( + AR="$(tc-getAR) cq" + AS="$(tc-getAS)" + CC="$(tc-getCC)" + CDEBUGFLAGS="${CFLAGS}" + CXX="$(tc-getCXX)" + CXXDEBUFLAGS="${CXXFLAGS}" + EXTRA_LDOPTIONS="${LDFLAGS}" + LD="$(tc-getLD)" + MAKE="${MAKE:-gmake}" + RANLIB="$(tc-getRANLIB)" + SHLIBGLOBALSFLAGS="${LDFLAGS}" + WORLDOPTS= + ) + + if multilib_is_native_abi ; then + # dumb fix for parallel make issue wrt #446598, Imake sux + emake "${emakeopts[@]}" -C server/dia all + emake "${emakeopts[@]}" -C server/dda/voxware all + emake "${emakeopts[@]}" -C server/os all + else + sed -i \ + -e 's/SUBDIRS =.*/SUBDIRS = include lib config/' \ + Makefile || die + fi + + emake "${emakeopts[@]}" +} + +multilib_src_install() { + # ranlib is used at install phase too wrt #446600 + emake RANLIB="$(tc-getRANLIB)" \ + DESTDIR="${D}" USRLIBDIR=/usr/$(get_libdir) \ + install install.man +} + +multilib_src_install_all() { + einstalldocs + if use doc; then + docinto doc + dodoc doc/{actions,protocol.txt,README} + docinto pdf + dodoc doc/pdf/*.pdf + fi + + mv -vf "${D}"/etc/nas/nasd.conf{.eg,} || die + + newconfd "${FILESDIR}"/nas.conf.d nas + newinitd "${FILESDIR}"/nas.init.d nas + + if ! use static-libs; then + rm -f "${D}"/usr/lib*/libaudio.a || die + fi +} |