Fixed issue #44.

Removed unnesessary include <sys/types.h> from stdio.h, stdlib.h,
string.h, strings.h and time.h.
This commit is contained in:
Sergey
2015-06-21 18:59:02 -07:00
parent aedd0138b3
commit bca590d42b
10 changed files with 52 additions and 12 deletions

View File

@@ -1,8 +1,22 @@
#ifndef _STDDEF_H_
#define _STDDEF_H_
typedef int ptrdiff_t;
#ifndef _SIZE_T
#define _SIZE_T
typedef unsigned size_t;
#endif
#ifndef NULL
#define NULL 0
#endif
/* Offset of member MEMBER in a struct of type TYPE. */
#if defined(__GNUC__) && __GNUC__ > 3
#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
#else
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE*)0)->MEMBER)
#endif
#endif /* _STDDEF_H_ */

View File

@@ -5,8 +5,6 @@
*/
#ifndef FILE
#include <sys/types.h>
#define BUFSIZ 1024
extern struct _iobuf {
int _cnt;
@@ -40,6 +38,11 @@ extern struct _iobuf {
#define NULL 0
#endif
#ifndef _SIZE_T
#define _SIZE_T
typedef unsigned size_t;
#endif
#define FILE struct _iobuf
#define EOF (-1)

View File

@@ -43,8 +43,6 @@
#ifndef _STDLIB_H_
#define _STDLIB_H_
#include <sys/types.h>
#ifndef NULL
#define NULL 0
#endif
@@ -54,6 +52,11 @@
#define RAND_MAX 0x7fff
#ifndef _SIZE_T
#define _SIZE_T
typedef unsigned size_t;
#endif
void abort (void);
int abs (int);
int atexit (void (*)(void));
@@ -83,7 +86,7 @@ char *_findenv (const char *name, int *offset);
void *alloca (size_t size);
int daemon (int, int);
char *devname (dev_t dev, mode_t type);
char *devname (int dev, int type);
int getloadavg (unsigned loadavg[], int nelem);
extern char *suboptarg; /* getsubopt(3) external variable */

View File

@@ -3,12 +3,15 @@
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
#include <sys/types.h>
#ifndef NULL
#define NULL 0
#endif
#ifndef _SIZE_T
#define _SIZE_T
typedef unsigned size_t;
#endif
char *strcat (char *, const char *);
char *strncat (char *, const char *, size_t);
char *strcpy (char *, const char *);

View File

@@ -30,7 +30,10 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/types.h>
#ifndef _SIZE_T
#define _SIZE_T
typedef unsigned size_t;
#endif
int bcmp(const void *, const void *, size_t);
void bcopy(const void *, void *, size_t);

View File

@@ -6,7 +6,15 @@
#ifndef _TIME_H
#define _TIME_H
#include <sys/types.h> /* for time_t */
#ifndef _TIME_T
#define _TIME_T
typedef long time_t;
#endif
#ifndef _SIZE_T
#define _SIZE_T
typedef unsigned size_t;
#endif
/*
* Structure returned by gmtime and localtime calls (see ctime(3)).

View File

@@ -6,7 +6,6 @@
#include <stdio.h>
#include <string.h>
#include <pwd.h>
#include <grp.h>
#include <syslog.h>
#include <stdlib.h>
#include <unistd.h>
@@ -14,6 +13,7 @@
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <grp.h>
char userbuf[64] = "USER=";
char homebuf[128] = "HOME=";

View File

@@ -1,5 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <grp.h>
#define MAXGRP 200

View File

@@ -6,6 +6,8 @@
#ifndef _STAT_H_
#define _STAT_H_
#include <sys/time.h>
struct stat
{
dev_t st_dev;

View File

@@ -50,7 +50,10 @@ typedef int ssize_t;
#define _SSIZE_T
#endif
#endif
#ifndef _TIME_T
#define _TIME_T
typedef long time_t;
#endif
typedef int dev_t;
#ifndef _OFF_T
#define _OFF_T