Wed Mar 13 11:09:28 2024 UTC (84d)
nbsed: Add __UNCONST compat.

This now builds on macOS, still failing on other OS.  Running the test suite
appears to show no differences, at least compared to macOS 14.3.1's sed.


(jperkin)
diff -r1.7 -r1.8 pkgsrc/textproc/nbsed/files/main.c

cvs diff -r1.7 -r1.8 pkgsrc/textproc/nbsed/files/main.c (expand / switch to unified diff)

--- pkgsrc/textproc/nbsed/files/main.c 2024/03/13 11:07:48 1.7
+++ pkgsrc/textproc/nbsed/files/main.c 2024/03/13 11:09:28 1.8
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: main.c,v 1.7 2024/03/13 11:07:48 jperkin Exp $ */ 1/* $NetBSD: main.c,v 1.8 2024/03/13 11:09:28 jperkin Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2013 Johann 'Myrkraverk' Oskarsson. 4 * Copyright (c) 2013 Johann 'Myrkraverk' Oskarsson.
5 * Copyright (c) 1992 Diomidis Spinellis. 5 * Copyright (c) 1992 Diomidis Spinellis.
6 * Copyright (c) 1992, 1993 6 * Copyright (c) 1992, 1993
7 * The Regents of the University of California. All rights reserved. 7 * The Regents of the University of California. All rights reserved.
8 * 8 *
9 * This code is derived from software contributed to Berkeley by 9 * This code is derived from software contributed to Berkeley by
10 * Diomidis Spinellis of Imperial College, University of London. 10 * Diomidis Spinellis of Imperial College, University of London.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
14 * are met: 14 * are met:
@@ -35,27 +35,27 @@ @@ -35,27 +35,27 @@
35 */ 35 */
36 36
37#if HAVE_CONFIG_H 37#if HAVE_CONFIG_H
38#include "config.h" 38#include "config.h"
39#endif 39#endif
40#if HAVE_NBTOOL_CONFIG_H 40#if HAVE_NBTOOL_CONFIG_H
41#include "nbtool_config.h" 41#include "nbtool_config.h"
42#endif 42#endif
43 43
44#include <nbcompat.h> 44#include <nbcompat.h>
45#if HAVE_SYS_CDEFS_H 45#if HAVE_SYS_CDEFS_H
46#include <sys/cdefs.h> 46#include <sys/cdefs.h>
47#endif 47#endif
48__RCSID("$NetBSD: main.c,v 1.7 2024/03/13 11:07:48 jperkin Exp $"); 48__RCSID("$NetBSD: main.c,v 1.8 2024/03/13 11:09:28 jperkin Exp $");
49#ifdef __FBSDID 49#ifdef __FBSDID
50__FBSDID("$FreeBSD: head/usr.bin/sed/main.c 252231 2013-06-26 04:14:19Z pfg $"); 50__FBSDID("$FreeBSD: head/usr.bin/sed/main.c 252231 2013-06-26 04:14:19Z pfg $");
51#endif 51#endif
52 52
53#ifndef lint 53#ifndef lint
54__COPYRIGHT("@(#) Copyright (c) 1992, 1993\ 54__COPYRIGHT("@(#) Copyright (c) 1992, 1993\
55 The Regents of the University of California. All rights reserved."); 55 The Regents of the University of California. All rights reserved.");
56#endif 56#endif
57 57
58#if 0 58#if 0
59static const char sccsid[] = "@(#)main.c 8.2 (Berkeley) 1/3/94"; 59static const char sccsid[] = "@(#)main.c 8.2 (Berkeley) 1/3/94";
60#endif 60#endif
61 61
@@ -103,26 +103,30 @@ static const char sccsid[] = "@(#)main.c @@ -103,26 +103,30 @@ static const char sccsid[] = "@(#)main.c
103#if HAVE_STDLIB_H 103#if HAVE_STDLIB_H
104#include <stdlib.h> 104#include <stdlib.h>
105#endif 105#endif
106#if HAVE_STRING_H 106#if HAVE_STRING_H
107#include <string.h> 107#include <string.h>
108#endif 108#endif
109#if HAVE_UNISTD_H 109#if HAVE_UNISTD_H
110#include <unistd.h> 110#include <unistd.h>
111#endif 111#endif
112 112
113#include "defs.h" 113#include "defs.h"
114#include "extern.h" 114#include "extern.h"
115 115
 116#ifndef __UNCONST
 117#define __UNCONST(a) ((void *)(unsigned long)(const void *)(a))
 118#endif
 119
116/* 120/*
117 * Linked list of units (strings and files) to be compiled 121 * Linked list of units (strings and files) to be compiled
118 */ 122 */
119struct s_compunit { 123struct s_compunit {
120 struct s_compunit *next; 124 struct s_compunit *next;
121 enum e_cut {CU_FILE, CU_STRING} type; 125 enum e_cut {CU_FILE, CU_STRING} type;
122 char *s; /* Pointer to string or fname */ 126 char *s; /* Pointer to string or fname */
123}; 127};
124 128
125/* 129/*
126 * Linked list pointer to compilation units and pointer to current 130 * Linked list pointer to compilation units and pointer to current
127 * next pointer. 131 * next pointer.
128 */ 132 */