According to the information on:
http://www.opengroup.org/onlinepubs/009695399/functions/swab.html the prototype for swab() should be in <unistd.h> and not in <string.h>. Move it, and update to match SUS. Leave the prototype in string.h for now, for backwards compat. PR: 74751 Submitted by: Craig Rodrigues <rodrigc@crodrigues.org> Discussed with: das
This commit is contained in:
parent
54bb820a75
commit
2f5cde3c64
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=138659
@ -108,8 +108,19 @@ char *strtok_r(char *, const char *, char **);
|
|||||||
#endif
|
#endif
|
||||||
size_t strxfrm(char * __restrict, const char * __restrict, size_t);
|
size_t strxfrm(char * __restrict, const char * __restrict, size_t);
|
||||||
#if __BSD_VISIBLE
|
#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
|
__END_DECLS
|
||||||
|
|
||||||
#endif /* _STRING_H_ */
|
#endif /* _STRING_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 setpgrp(pid_t _pid, pid_t _pgrp); /* obsoleted by setpgid() */
|
||||||
int setregid(gid_t, gid_t);
|
int setregid(gid_t, gid_t);
|
||||||
int setreuid(uid_t, uid_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);
|
void sync(void);
|
||||||
useconds_t ualarm(useconds_t, useconds_t);
|
useconds_t ualarm(useconds_t, useconds_t);
|
||||||
int usleep(useconds_t);
|
int usleep(useconds_t);
|
||||||
|
@ -41,9 +41,9 @@
|
|||||||
.Sh LIBRARY
|
.Sh LIBRARY
|
||||||
.Lb libc
|
.Lb libc
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.In string.h
|
.In unistd.h
|
||||||
.Ft void
|
.Ft void
|
||||||
.Fn swab "const void * restrict src" "void * restrict dst" "size_t len"
|
.Fn swab "const void * restrict src" "void * restrict dst" "ssize_t len"
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
The function
|
The function
|
||||||
.Fn swab
|
.Fn swab
|
||||||
|
@ -40,10 +40,10 @@ static char sccsid[] = "@(#)swab.c 8.1 (Berkeley) 6/4/93";
|
|||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <string.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
swab(const void * __restrict from, void * __restrict to, size_t len)
|
swab(const void * __restrict from, void * __restrict to, ssize_t len)
|
||||||
{
|
{
|
||||||
unsigned long temp;
|
unsigned long temp;
|
||||||
int n;
|
int n;
|
||||||
|
Loading…
Reference in New Issue
Block a user