From 2f5cde3c64228de95d392e408f3198df9ba414a1 Mon Sep 17 00:00:00 2001 From: Tom Rhodes Date: Fri, 10 Dec 2004 15:24:40 +0000 Subject: According to the information on: http://www.opengroup.org/onlinepubs/009695399/functions/swab.html the prototype for swab() should be in and not in . Move it, and update to match SUS. Leave the prototype in string.h for now, for backwards compat. PR: 74751 Submitted by: Craig Rodrigues Discussed with: das --- include/string.h | 15 +++++++++++++-- include/unistd.h | 7 ++++++- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/string.h b/include/string.h index 3844d41738ec..efc8aecec081 100644 --- a/include/string.h +++ b/include/string.h @@ -108,8 +108,19 @@ char *strtok_r(char *, const char *, char **); #endif size_t strxfrm(char * __restrict, const char * __restrict, size_t); #if __BSD_VISIBLE -void swab(const void *, void *, size_t); -#endif + +#ifndef _SWAB_DECLARED +#define _SWAB_DECLARED + +#ifndef _SSIZE_T_DECLARED +typedef __ssize_t ssize_t; +#define _SSIZE_T_DECLARED +#endif /* _SIZE_T_DECLARED */ + +void swab(const void * __restrict, void * __restrict, ssize_t); +#endif /* _SWAB_DECLARED */ + +#endif /* __BSD_VISIBLE */ __END_DECLS #endif /* _STRING_H_ */ diff --git a/include/unistd.h b/include/unistd.h index 56551f8cd40c..fa7346298c08 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -436,7 +436,12 @@ ssize_t pwrite(int, const void *, size_t, off_t); int setpgrp(pid_t _pid, pid_t _pgrp); /* obsoleted by setpgid() */ int setregid(gid_t, gid_t); int setreuid(uid_t, uid_t); -/* void swab(const void * __restrict, void * __restrict, ssize_t); */ + +#ifndef _SWAB_DECLARED +#define _SWAB_DECLARED +void swab(const void * __restrict, void * __restrict, ssize_t); +#endif /* _SWAB_DECLARED */ + void sync(void); useconds_t ualarm(useconds_t, useconds_t); int usleep(useconds_t); -- cgit v1.3