Skip to content

Commit 2aaa3b3

Browse files
author
Elbing Miss
committed
Fixing more things:
Cleaning pragma lines, useles with gcc. Because building binutils warns at every step miserably. exec*() family re-declared with newest prototype. POSIX is now newer and they were warning without reason. Added some needed things more. Now we have things that linux guesses are in headers like resources.h, and I did a few ifdefs in binutils to avoid stupids non-standard headers includements. Harvey has all of that functions in APEX, but in standard places, not where GNU wants. For example bzero(). libbsd will be included into libap, once we have native toolchain running, because bsd.h is a f* waste of time and a rare bridge between string.h and strings.h. And now, with musl source imported, all is polluted with BSD things, in 2016 all of them normal, usual and mostly standard. We're not BL guys, so there's no reason to differentiate one code from another. ap/stdio dir has many things from BSD sources, that Unix systems were including during years. Change-Id: Ib58692f415b87e9cb3669d93b820bf4c183d75cf
1 parent 66fd4b2 commit 2aaa3b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+61
-83
lines changed

include/Plan9libnet.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#ifndef _NET_EXTENSION
1313
This header file is not defined in ANSI or POSIX
1414
#endif
15-
#pragma lib "/$M/lib/ape/libnet.a"
1615

1716
#define NETPATHLEN 40
1817

include/assert.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* in the LICENSE file.
88
*/
99

10-
#pragma lib "/$M/lib/ape/libap.a"
1110

1211
#undef assert
1312
#ifdef NDEBUG

include/bsd.h

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@
1313

1414
#ifndef __BSD_H_
1515
#define __BSD_H_
16-
#pragma src "/sys/src/ape/lib/bsd"
17-
#pragma lib "/$M/lib/ape/libbsd.a"
1816

19-
#ifndef __TYPES_H
2017
#include <sys/types.h>
2118
#include <string.h>
22-
#endif
19+
#include <strings.h>
2320

2421
#ifdef __cplusplus
2522
extern "C" {
@@ -30,17 +27,6 @@ extern "C" {
3027
typedef unsigned long size_t;
3128
#endif
3229

33-
/* ifndefs because X11 stuff (ugh) */
34-
#ifndef bcopy
35-
extern void bcopy(void*, void*, size_t);
36-
#endif
37-
#ifndef bcmp
38-
extern int bcmp(void*, void*, size_t);
39-
#endif
40-
#ifndef bzero
41-
extern void bzero(void*, size_t);
42-
#endif
43-
extern int ffs(unsigned int);
4430
extern void bhappy(void*);
4531
extern int rresvport(int*);
4632
extern int rcmd(char**, int, char*, char*, char*, int*);

include/ctype.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#ifndef __CTYPE
1111
#define __CTYPE
12-
#pragma lib "/$M/lib/ape/libap.a"
1312

1413
#ifdef __cplusplus
1514
extern "C" {

include/dirent.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#ifndef __DIRENT_H
1111
#define __DIRENT_H
12-
#pragma lib "/$M/lib/ape/libap.a"
1312
/*
1413
* this must be a power of 2 and a multiple of all the ones in the system
1514
*/

include/draw.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
#ifndef __DRAW_H_
1515
#define __DRAW_H_
16-
#pragma src "/sys/src/ape/lib/draw"
17-
#pragma lib "/$M/lib/ape/libdraw.a"
1816

1917
#include <u.h>
2018
#include <fmt.h>
@@ -34,8 +32,6 @@ typedef struct RGB RGB;
3432
typedef struct Screen Screen;
3533
typedef struct Subfont Subfont;
3634

37-
#pragma varargck type "R" Rectangle
38-
#pragma varargck type "P" Point
3935
extern int Rfmt(Fmt*);
4036
extern int Pfmt(Fmt*);
4137

include/errno.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#ifndef __ERRNO
1111
#define __ERRNO
12-
#pragma lib "/$M/lib/ape/libap.a"
1312

1413
extern int errno;
1514

include/error.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#ifndef _RESEARCH_SOURCE
1313
This header file is not defined in pure ANSI or POSIX
1414
#endif
15-
#pragma lib "/$M/lib/ape/libv.a"
1615

1716
#ifdef __cplusplus
1817
extern "C" {

include/fcntl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#ifndef _POSIX_SOURCE
1313
This header file is not defined in pure ANSI
1414
#endif
15-
#pragma lib "/$M/lib/ape/libap.a"
1615

1716
#include <sys/types.h>
1817

include/fmt.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
#ifndef __FMT_H_
1515
#define __FMT_H_
16-
#pragma src "/sys/src/ape/lib/fmt"
17-
#pragma lib "/$M/lib/ape/libfmt.a"
1816

1917
#include <u.h>
2018

include/grp.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#ifndef _POSIX_SOURCE
1313
This header file is not defined in pure ANSI
1414
#endif
15-
#pragma lib "/$M/lib/ape/libap.a"
1615
#include <sys/types.h>
1716

1817
struct group

include/lib9.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#if !defined(_RESEARCH_SOURCE) && !defined(_PLAN9_SOURCE)
1313
This header file is an extension to ANSI/POSIX
1414
#endif
15-
#pragma lib "/$M/lib/ape/lib9.a"
1615

1716
#include <u.h> /* ick; need Rune defined below */
1817

include/libl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#ifndef _RESEARCH_SOURCE
1313
This header file is not defined in ANSI or POSIX
1414
#endif
15-
#pragma lib "/$M/lib/ape/libl.a"
1615

1716
extern int printable(int);
1817
extern void allprint(int8_t);

include/libnet.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#ifndef _NET_EXTENSION
1313
This header file is not defined in ANSI or POSIX
1414
#endif
15-
#pragma lib "/$M/lib/ape/libnet.a"
1615

1716
#define NETPATHLEN 40
1817

include/libsec.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
#ifndef __LIBSEC_H_
1515
#define __LIBSEC_H_
16-
#pragma src "/sys/src/ape/lib/sec"
17-
#pragma lib "/$M/lib/ape/libsec.a"
1816

1917
#ifndef _MPINT
2018
typedef struct mpint mpint;

include/libv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#ifndef _RESEARCH_SOURCE
1313
This header file is not defined in ANSI or POSIX
1414
#endif
15-
#pragma lib "/$M/lib/ape/libv.a"
1615

1716
#ifdef __cplusplus
1817
extern "C" {

include/lock.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
#ifndef __LOCK_H
1515
#define __LOCK_H
16-
#pragma lib "/$M/lib/ape/libap.a"
1716

1817
#include <u.h>
1918

include/mp.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
#ifndef __LIBMP_H_
1515
#define __LIBMP_H_
1616

17-
#pragma src "/sys/src/ape/lib/mp"
18-
#pragma lib "/$M/lib/ape/libmp.a"
1917

2018
typedef unsigned int mpdigit; /* from /$objtype/include/u.h */
2119

@@ -143,7 +141,6 @@ typedef struct CRTpre CRTpre; /* precomputed values for converting */
143141
/* twixt residues and mpint */
144142
typedef struct CRTres CRTres; /* residue form of an mpint */
145143

146-
#pragma incomplete CRTpre
147144

148145
struct CRTres
149146
{
@@ -158,5 +155,4 @@ void crtprefree(CRTpre*);
158155
void crtresfree(CRTres*);
159156

160157

161-
#pragma varargck type "B" mpint*
162158
#endif

include/pwd.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#ifndef _POSIX_SOURCE
1313
This header file is not defined in pure ANSI
1414
#endif
15-
#pragma lib "/$M/lib/ape/libap.a"
1615
#include <sys/types.h>
1716

1817
struct passwd

include/qlock.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
#ifndef __QLOCK_H_
1515
#define __QLOCK_H_
16-
#pragma lib "/$M/lib/ape/lib9.a"
1716

1817
#include <u.h>
1918
#include <lock.h>

include/regexp.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#ifndef _REGEXP_EXTENSION
1313
This header file is an extension to ANSI/POSIX
1414
#endif
15-
#pragma lib "/$M/lib/ape/libregexp.a"
1615

1716
#ifdef UTF
1817
#define Runeself 0xA0

include/select.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#ifndef _BSD_EXTENSION
1313
This header file is an extension to ANSI/POSIX
1414
#endif
15-
#pragma lib "/$M/lib/ape/libap.a"
1615

1716
#ifndef _FD_SET_T
1817
#define _FD_SET_T

include/setjmp.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#ifndef __SETJMP_H
1111
#define __SETJMP_H
12-
#pragma lib "/$M/lib/ape/libap.a"
1312

1413
typedef int jmp_buf[10];
1514
#ifdef _POSIX_SOURCE

include/signal.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#ifndef __SIGNAL_H
1111
#define __SIGNAL_H
12-
#pragma lib "/$M/lib/ape/libap.a"
1312

1413
typedef int sig_atomic_t;
1514
typedef signed int int32_t;

include/stdio.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#ifndef _STDIO_H_
1111
#define _STDIO_H_
12-
#pragma lib "/$M/lib/ape/libap.a"
1312

1413
/*
1514
* pANS stdio.h
@@ -185,7 +184,6 @@ extern char *ctermid_r(char *);
185184
#endif
186185

187186
#ifdef _BSD_EXTENSION
188-
#pragma lib "/$M/lib/ape/libbsd.a"
189187
extern FILE *popen(char *, char *);
190188
extern int pclose(FILE *);
191189
#endif

include/stdlib.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#ifndef __STDLIB_H
1111
#define __STDLIB_H
12-
#pragma lib "/$M/lib/ape/libap.a"
1312

1413
#include <stddef.h>
1514

include/string.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#ifndef __STRING_H_
1111
#define __STRING_H_
12-
#pragma lib "/$M/lib/ape/libap.a"
1312

1413
#include <stddef.h>
1514

@@ -27,7 +26,7 @@ extern char *strncat(char *, const char *, size_t);
2726
extern int memcmp(const void *, const void *, size_t);
2827
extern int strcmp(const char *, const char *);
2928
extern int strcoll(const char *, const char *);
30-
extern char* strdup(char*);
29+
extern char* strdup(const char*);
3130
extern int strncmp(const char *, const char *, size_t);
3231
extern size_t strxfrm(char *, const char *, size_t);
3332
extern void *memchr(const void *, int, size_t);

include/strings.h

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#ifndef _STRINGS_H
2+
#define _STRINGS_H
3+
4+
#ifndef __STDDEF_H
5+
#include <stddef.h>
6+
#endif
7+
8+
#ifdef __cplusplus
9+
extern "C" {
10+
#endif
11+
12+
13+
#define __NEED_size_t
14+
#define __NEED_locale_t
15+
16+
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_POSIX_SOURCE) \
17+
|| (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE+0 < 200809L) \
18+
|| (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE+0 < 700)
19+
extern int bcmp (const void *, const void *, size_t);
20+
extern void bcopy (const void *, void *, size_t);
21+
extern void bzero (void *, size_t);
22+
extern char *index (const char *, int);
23+
extern char *rindex (const char *, int);
24+
#endif
25+
26+
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
27+
extern int ffs (int);
28+
extern int ffsl (long);
29+
extern int ffsll (long long);
30+
#endif
31+
32+
extern int strcasecmp (const char *, const char *);
33+
extern int strncasecmp (const char *, const char *, size_t);
34+
35+
extern int strcasecmp_l (const char *, const char *, locale_t);
36+
extern int strncasecmp_l (const char *, const char *, size_t, locale_t);
37+
38+
#ifdef __cplusplus
39+
}
40+
#endif
41+
42+
#endif

include/sys/pty.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
This header file is an extension to ANSI/POSIX
1818
#endif
1919

20-
#pragma lib "/$M/lib/ape/libbsd.a"
2120

2221
char* ptsname(int);
2322
char* ptmname(int);

include/sys/select.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#ifndef _BSD_EXTENSION
1313
This header file is an extension to ANSI/POSIX
1414
#endif
15-
#pragma lib "/$M/lib/ape/libap.a"
1615

1716
#ifndef _FD_SET_T
1817
#define _FD_SET_T

include/sys/socket.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
This header file is an extension to ANSI/POSIX
1515
#endif
1616

17-
#pragma lib "/$M/lib/ape/libbsd.a"
1817

1918
#ifdef __cplusplus
2019
extern "C" {

include/sys/time.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#ifndef __SYSTIME_H
1111
#define __SYSTIME_H
12-
#pragma lib "/$M/lib/ape/libap.a"
1312

1413
#include <sys/types.h>
1514

include/sys/times.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#ifndef __TIMES_H
1111
#define __TIMES_H
12-
#pragma lib "/$M/lib/ape/libap.a"
1312

1413
#ifndef _CLOCK_T
1514
#define _CLOCK_T

include/sys/types.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#ifndef __TYPES_H
1111
#define __TYPES_H
1212

13-
#pragma lib "/$M/lib/ape/libap.a"
1413
typedef unsigned short ino_t;
1514
typedef unsigned short dev_t;
1615
typedef long long off_t;

include/sys/uio.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
extern "C" {
1919
#endif
2020

21-
#pragma lib "/$M/lib/ape/libbsd.a"
2221

2322
/*
2423
* Copyright (c) 1982, 1986 Regents of the University of California.

include/sys/utsname.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#ifndef __UTSNAME
1111
#define __UTSNAME
12-
#pragma lib "/$M/lib/ape/libap.a"
1312

1413
struct utsname {
1514
char *sysname;

include/sys/wait.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#ifndef __WAIT_H
1111
#define __WAIT_H
12-
#pragma lib "/$M/lib/ape/libap.a"
1312

1413
/* flag bits for third argument of waitpid */
1514
#define WNOHANG 0x1

0 commit comments

Comments
 (0)