mirror of
https://github.com/openbsd/ports.git
synced 2026-06-17 23:13:55 +02:00
Prepare for forthcoming stdio opaque diffs. Don't access the internal
of the FILE object and use the functions from <stdio_ext.h> instead. ok sthen
This commit is contained in:
@@ -9,7 +9,7 @@ SITES= http://www.arcane-labs.net/download/OpenBSD/
|
|||||||
PERMIT_PACKAGE= No
|
PERMIT_PACKAGE= No
|
||||||
PERMIT_DISTFILES= No
|
PERMIT_DISTFILES= No
|
||||||
|
|
||||||
REVISION = 2
|
REVISION = 3
|
||||||
WANTLIB= c
|
WANTLIB= c
|
||||||
|
|
||||||
CONFIGURE_STYLE= gnu dest
|
CONFIGURE_STYLE= gnu dest
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
Disable replacing {get,put}c() by accessing FILE internal.
|
||||||
|
|
||||||
|
Index: freeze.h
|
||||||
|
--- freeze.h.orig
|
||||||
|
+++ freeze.h
|
||||||
|
@@ -5,21 +5,6 @@
|
||||||
|
# include <sys/stdtypes.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-#ifndef getc
|
||||||
|
-# ifdef m88k /* Green Hill C library bug. */
|
||||||
|
-# define getc(p) (--(p)->_cnt < 0 ? __filbuf(p) : (int) *(p)->_ptr++)
|
||||||
|
-# else
|
||||||
|
-# define getc(p) (--(p)->_cnt < 0 ? _filbuf(p) : (int) *(p)->_ptr++)
|
||||||
|
-# endif
|
||||||
|
-#endif
|
||||||
|
-#ifndef putc
|
||||||
|
-# ifdef m88k /* Green Hill C library bug. */
|
||||||
|
-# define putc(x, p) (--(p)->_cnt < 0 ? __flsbuf((unsigned char) (x), (p)) : (int) (*(p)->_ptr++ = (unsigned char) (x)))
|
||||||
|
-# else
|
||||||
|
-# define putc(x, p) (--(p)->_cnt < 0 ? _flsbuf((unsigned char) (x), (p)) : (int) (*(p)->_ptr++ = (unsigned char) (x)))
|
||||||
|
-# endif
|
||||||
|
-#endif
|
||||||
|
-
|
||||||
|
#if !defined(MSDOS) && defined(__MSDOS__)
|
||||||
|
# define MSDOS
|
||||||
|
#endif
|
||||||
+1
-1
@@ -5,7 +5,7 @@ DISTNAME= sox_ng-${V}
|
|||||||
PKGNAME= sox-${V}
|
PKGNAME= sox-${V}
|
||||||
SHARED_LIBS += sox_ng 0.0 # 3.0
|
SHARED_LIBS += sox_ng 0.0 # 3.0
|
||||||
|
|
||||||
REVISION= 2
|
REVISION= 3
|
||||||
|
|
||||||
CATEGORIES= audio
|
CATEGORIES= audio
|
||||||
HOMEPAGE= https://sox.sourceforge.net/
|
HOMEPAGE= https://sox.sourceforge.net/
|
||||||
|
|||||||
@@ -1,7 +1,20 @@
|
|||||||
|
Use functions from stdio_ext.h instead of using inside FILE object
|
||||||
|
|
||||||
Index: src/formats.c
|
Index: src/formats.c
|
||||||
--- src/formats.c.orig
|
--- src/formats.c.orig
|
||||||
+++ src/formats.c
|
+++ src/formats.c
|
||||||
@@ -392,7 +392,7 @@ static FILE * xfopen(char const * identifier, char con
|
@@ -33,6 +33,10 @@
|
||||||
|
#include <io.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#ifdef __OpenBSD__
|
||||||
|
+ #include <stdio_ext.h>
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#if HAVE_MAGIC
|
||||||
|
#include <magic.h>
|
||||||
|
#endif
|
||||||
|
@@ -392,7 +396,7 @@ static FILE * xfopen(char const * identifier, char con
|
||||||
else if (is_url(identifier)) {
|
else if (is_url(identifier)) {
|
||||||
FILE * f = NULL;
|
FILE * f = NULL;
|
||||||
#ifdef HAVE_POPEN
|
#ifdef HAVE_POPEN
|
||||||
@@ -10,3 +23,23 @@ Index: src/formats.c
|
|||||||
char * command = lsx_malloc(strlen(command_format) + strlen(identifier));
|
char * command = lsx_malloc(strlen(command_format) + strlen(identifier));
|
||||||
sprintf(command, command_format, identifier);
|
sprintf(command, command_format, identifier);
|
||||||
f = popen(command, POPEN_MODE);
|
f = popen(command, POPEN_MODE);
|
||||||
|
@@ -410,6 +414,11 @@ static FILE * xfopen(char const * identifier, char con
|
||||||
|
* Works by resetting the FILE buffer pointer */
|
||||||
|
static void UNUSED rewind_pipe(FILE * fp)
|
||||||
|
{
|
||||||
|
+#ifdef __OpenBSD__
|
||||||
|
+ size_t sz;
|
||||||
|
+ if (__freadptr(fp, &sz) != NULL && sz >= PIPE_AUTO_DETECT_SIZE)
|
||||||
|
+ __freadptrinc(fp, -PIPE_AUTO_DETECT_SIZE);
|
||||||
|
+#else
|
||||||
|
/* _FSTDIO is for Torek stdio (i.e. most BSD-derived libc's)
|
||||||
|
* In theory, we no longer need to check _NEWLIB_VERSION or __APPLE__ */
|
||||||
|
#if defined _FSTDIO || defined _NEWLIB_VERSION || defined __APPLE__
|
||||||
|
@@ -427,6 +436,7 @@ static void UNUSED rewind_pipe(FILE * fp)
|
||||||
|
* or add support for your compiler in the lines above.
|
||||||
|
* Test with cat monkey.wav | ./sox --info - */
|
||||||
|
# define NO_REWIND_PIPE
|
||||||
|
+#endif
|
||||||
|
#endif
|
||||||
|
(void)fp;
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ PKGNAME = kermit-9.0.302
|
|||||||
DISTNAME = cku302
|
DISTNAME = cku302
|
||||||
CATEGORIES = comms
|
CATEGORIES = comms
|
||||||
HOMEPAGE = https://www.kermitproject.org/
|
HOMEPAGE = https://www.kermitproject.org/
|
||||||
REVISION = 0
|
REVISION = 1
|
||||||
|
|
||||||
# THE C-KERMIT 9.0 LICENSE (Revised 3-Clause BSD License)
|
# THE C-KERMIT 9.0 LICENSE (Revised 3-Clause BSD License)
|
||||||
PERMIT_PACKAGE = Yes
|
PERMIT_PACKAGE = Yes
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
Use __freadahead instead of accessing internal FILE
|
||||||
|
|
||||||
|
Index: ckucmd.c
|
||||||
|
--- ckucmd.c.orig
|
||||||
|
+++ ckucmd.c
|
||||||
|
@@ -212,6 +212,10 @@ modules would have to be changed...
|
||||||
|
#include <io.h>
|
||||||
|
#endif /* OS2 */
|
||||||
|
|
||||||
|
+#ifdef __OpenBSD__
|
||||||
|
+#include <stdio_ext.h>
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#ifdef OSK
|
||||||
|
#define cc ccount /* OS-9/68K compiler bug */
|
||||||
|
#endif /* OSK */
|
||||||
|
@@ -7328,7 +7332,9 @@ cmdgetc(timelimit) int timelimit; { /* Get a character
|
||||||
|
#ifndef USE_FILE_CNT
|
||||||
|
#ifndef USE_FILE__CNT
|
||||||
|
#ifdef BSD44 /* {Free,Open,Net}BSD, BSDI */
|
||||||
|
+#ifndef __OpenBSD__ /* recent OpenBSD hides __sFILE */
|
||||||
|
#define USE_FILE_R
|
||||||
|
+#endif
|
||||||
|
#endif /* BSD44 */
|
||||||
|
#endif /* USE_FILE__CNT */
|
||||||
|
#endif /* USE_FILE_CNT */
|
||||||
|
@@ -7362,6 +7368,9 @@ cmdconchk() {
|
||||||
|
#ifdef OS2
|
||||||
|
x = conchk(); /* Check device-driver buffer */
|
||||||
|
if (x < 0) x = 0;
|
||||||
|
+#elif defined(__OpenBSD__)
|
||||||
|
+ x = __freadahead(stdin);
|
||||||
|
+ if (x < 0) x = 0;
|
||||||
|
#else /* OS2 */
|
||||||
|
#ifdef CMD_CONINC /* See cmdgetc() */
|
||||||
|
x = conchk(); /* Check device-driver buffer */
|
||||||
|
@@ -7395,7 +7404,7 @@ cmdconchk() {
|
||||||
|
if (x == 0) x = conchk();
|
||||||
|
if (x < 0) x = 0;
|
||||||
|
#else /* USE_FILE_CNT */
|
||||||
|
-#ifdef USE_FILE_R /* FreeBSD, OpenBSD, etc */
|
||||||
|
+#ifdef USE_FILE_R /* FreeBSD, etc */
|
||||||
|
debug(F101,"cmdconchk stdin->_r","",stdin->_r);
|
||||||
|
x = stdin->_r;
|
||||||
|
if (x == 0) x = conchk();
|
||||||
@@ -6,7 +6,7 @@ COMMENT-wnn4-canna= library for Japanese Input Method canna or wnn4
|
|||||||
FULLPKGNAME= ja-onew${FLAVOR_EXT}-2.2.10
|
FULLPKGNAME= ja-onew${FLAVOR_EXT}-2.2.10
|
||||||
|
|
||||||
DISTNAME= jvim2.0r+onew2.2.10
|
DISTNAME= jvim2.0r+onew2.2.10
|
||||||
REVISION= 4
|
REVISION= 5
|
||||||
CATEGORIES= japanese
|
CATEGORIES= japanese
|
||||||
|
|
||||||
SITES= ftp://ftp.lab.kdd.co.jp/Japan/onew/ \
|
SITES= ftp://ftp.lab.kdd.co.jp/Japan/onew/ \
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
--- sys/sys.h.orig Fri Jun 30 06:56:38 1995
|
Use __freadahead() instead of accessing inside FILE object.
|
||||||
+++ sys/sys.h Sun Dec 8 15:57:59 2013
|
|
||||||
|
Index: sys/sys.h
|
||||||
|
--- sys/sys.h.orig
|
||||||
|
+++ sys/sys.h
|
||||||
@@ -23,6 +23,11 @@
|
@@ -23,6 +23,11 @@
|
||||||
* terminal control: {USE_SGTTY, USE_TERMIO, USE_TERMIOS}
|
* terminal control: {USE_SGTTY, USE_TERMIO, USE_TERMIOS}
|
||||||
*/
|
*/
|
||||||
@@ -12,12 +15,15 @@
|
|||||||
#if defined(sunos) \
|
#if defined(sunos) \
|
||||||
|| defined(pureBSD43) \
|
|| defined(pureBSD43) \
|
||||||
|| defined(ultrix) \
|
|| defined(ultrix) \
|
||||||
@@ -69,7 +74,7 @@
|
@@ -69,7 +74,10 @@
|
||||||
#define READYCC(fp) (fp->_egptr - fp->_gptr)
|
#define READYCC(fp) (fp->_egptr - fp->_gptr)
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
-#if defined(bsdi) || defined(__FreeBSD__)
|
-#if defined(bsdi) || defined(__FreeBSD__)
|
||||||
+#if defined(bsdi) || defined(__FreeBSD__) || defined(__OpenBSD__)
|
+#ifdef __OpenBSD__
|
||||||
|
+#include <stdio_ext.h>
|
||||||
|
+#define READYCC(fp) __freadahead(fp)
|
||||||
|
+#elif defined(bsdi) || defined(__FreeBSD__)
|
||||||
#define READYCC(fp) (fp->_r)
|
#define READYCC(fp) (fp->_r)
|
||||||
#else
|
#else
|
||||||
#define READYCC(fp) (fp->_cnt)
|
#define READYCC(fp) (fp->_cnt)
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ COMMENT= Scheme interpreter with Tk interface
|
|||||||
|
|
||||||
STK_VERSION= 4.0.1
|
STK_VERSION= 4.0.1
|
||||||
DISTNAME= STk-${STK_VERSION}
|
DISTNAME= STk-${STK_VERSION}
|
||||||
REVISION= 19
|
REVISION= 20
|
||||||
CATEGORIES= lang
|
CATEGORIES= lang
|
||||||
|
|
||||||
HOMEPAGE= http://kaolin.unice.fr/STk/
|
HOMEPAGE= http://kaolin.unice.fr/STk/
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
Use __fpending() instead of accessing FILE object internal.
|
||||||
|
|
||||||
|
Index: Snow/io.c
|
||||||
|
--- Snow/io.c.orig
|
||||||
|
+++ Snow/io.c
|
||||||
|
@@ -60,6 +60,11 @@
|
||||||
|
#endif
|
||||||
|
#define max(a,b) ((a)>(b)? (a) : (b))
|
||||||
|
|
||||||
|
+#ifdef __OpenBSD__
|
||||||
|
+#include <stdio_ext.h>
|
||||||
|
+# define READ_DATA_PENDING(fp) __fpending(fp)
|
||||||
|
+#else
|
||||||
|
+
|
||||||
|
#ifdef _STDIO_USES_IOSTREAM /* GNU libc */
|
||||||
|
# if defined(_IO_STDIO_H) || defined (linux)
|
||||||
|
# define READ_DATA_PENDING(fp) (max(0,(fp)->_IO_read_end - (fp)->_IO_read_ptr))
|
||||||
|
@@ -76,6 +81,8 @@
|
||||||
|
# else
|
||||||
|
# define READ_DATA_PENDING(fp) (fp->_cnt)
|
||||||
|
# endif
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
Use __fpending() instead of accessing FILE object internal.
|
||||||
|
|
||||||
|
Index: Src/io.c
|
||||||
|
--- Src/io.c.orig
|
||||||
|
+++ Src/io.c
|
||||||
|
@@ -60,6 +60,11 @@
|
||||||
|
#endif
|
||||||
|
#define max(a,b) ((a)>(b)? (a) : (b))
|
||||||
|
|
||||||
|
+#ifdef __OpenBSD__
|
||||||
|
+#include <stdio_ext.h>
|
||||||
|
+# define READ_DATA_PENDING(fp) __fpending(fp)
|
||||||
|
+#else
|
||||||
|
+
|
||||||
|
#ifdef _STDIO_USES_IOSTREAM /* GNU libc */
|
||||||
|
# if defined(_IO_STDIO_H) || defined (linux)
|
||||||
|
# define READ_DATA_PENDING(fp) (max(0,(fp)->_IO_read_end - (fp)->_IO_read_ptr))
|
||||||
|
@@ -76,6 +81,8 @@
|
||||||
|
# else
|
||||||
|
# define READ_DATA_PENDING(fp) (fp->_cnt)
|
||||||
|
# endif
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static char static_buffer[BUFFER_SIZE+1], *buffer = static_buffer;
|
||||||
@@ -6,11 +6,12 @@ DISTNAME = icon-v951src
|
|||||||
CATEGORIES = lang
|
CATEGORIES = lang
|
||||||
SITES = http://www.cs.arizona.edu/icon/ftp/packages/unix/
|
SITES = http://www.cs.arizona.edu/icon/ftp/packages/unix/
|
||||||
DISTFILES = icon-v951src.tgz
|
DISTFILES = icon-v951src.tgz
|
||||||
|
REVISION= 0
|
||||||
|
|
||||||
MULTI_PACKAGES = -main #-compiler
|
MULTI_PACKAGES = -main #-compiler
|
||||||
|
|
||||||
PKGNAME-main = icon-interp-${VERSION}
|
PKGNAME-main = icon-interp-${VERSION}
|
||||||
REVISION-main = 0
|
REVISION-main = 1
|
||||||
|
|
||||||
# Public domain
|
# Public domain
|
||||||
PERMIT_PACKAGE = Yes
|
PERMIT_PACKAGE = Yes
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
Use __freadahead() instead of accessing inside FILE object.
|
||||||
|
|
||||||
|
Index: ipl/cfuncs/fpoll.c
|
||||||
|
--- ipl/cfuncs/fpoll.c.orig
|
||||||
|
+++ ipl/cfuncs/fpoll.c
|
||||||
|
@@ -32,6 +32,9 @@
|
||||||
|
#include <string.h> /* for memset call from FD_ZERO (solaris gcc) */
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
+#if defined(__OpenBSD__)
|
||||||
|
+#include <stdio_ext.h>
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#include "icall.h"
|
||||||
|
|
||||||
|
@@ -60,7 +63,10 @@ int fpoll(int argc, descriptor *argv) /*: await data f
|
||||||
|
|
||||||
|
/* check for data already in buffer */
|
||||||
|
/* there's no legal way to do this in C; we cheat */
|
||||||
|
-#if defined(__GLIBC__) && defined(_STDIO_USES_IOSTREAM) /* new GCC library */
|
||||||
|
+#if defined(__OpenBSD__)
|
||||||
|
+ if (__freadahead(f) > 0)
|
||||||
|
+ RetArg(1);
|
||||||
|
+#elif defined(__GLIBC__) && defined(_STDIO_USES_IOSTREAM) /* new GCC library */
|
||||||
|
if (f->_IO_read_ptr < f->_IO_read_end)
|
||||||
|
RetArg(1);
|
||||||
|
#elif defined(__GLIBC__) /* old GCC library */
|
||||||
Reference in New Issue
Block a user