diff options
author | 2015-08-27 04:37:09 +0000 | |
---|---|---|
committer | 2015-08-27 04:37:09 +0000 | |
commit | bb64080b0f4926cfaad11f8655a5a0ff1c21e50f (patch) | |
tree | 2f9ddff73dde02f16705737abba78e6aa5e185c8 /lib/libc/stdio | |
parent | Move the __rand48_* declarations into rand48.h, and then hide both them (diff) | |
download | wireguard-openbsd-bb64080b0f4926cfaad11f8655a5a0ff1c21e50f.tar.xz wireguard-openbsd-bb64080b0f4926cfaad11f8655a5a0ff1c21e50f.zip |
Use static and __{BEGIN,ENV}_HIDDEN_DECLS to hide a bunch of internal
symbols that are not longer exported. (This improves the generated code.)
ok deraadt@
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r-- | lib/libc/stdio/findfp.c | 4 | ||||
-rw-r--r-- | lib/libc/stdio/fvwrite.h | 4 | ||||
-rw-r--r-- | lib/libc/stdio/glue.h | 4 | ||||
-rw-r--r-- | lib/libc/stdio/local.h | 12 |
4 files changed, 16 insertions, 8 deletions
diff --git a/lib/libc/stdio/findfp.c b/lib/libc/stdio/findfp.c index ee866fa26ce..0cdd1faf3a0 100644 --- a/lib/libc/stdio/findfp.c +++ b/lib/libc/stdio/findfp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: findfp.c,v 1.17 2015/01/16 16:48:51 deraadt Exp $ */ +/* $OpenBSD: findfp.c,v 1.18 2015/08/27 04:37:09 guenther Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -58,7 +58,7 @@ static struct glue uglue = { 0, FOPEN_MAX - 3, usual }; static struct glue *lastglue = &uglue; _THREAD_PRIVATE_MUTEX(__sfp_mutex); -struct __sfileext __sFext[3]; +static struct __sfileext __sFext[3]; FILE __sF[3] = { std(__SRD, STDIN_FILENO), /* stdin */ std(__SWR, STDOUT_FILENO), /* stdout */ diff --git a/lib/libc/stdio/fvwrite.h b/lib/libc/stdio/fvwrite.h index d3a309b2938..f04565bc28a 100644 --- a/lib/libc/stdio/fvwrite.h +++ b/lib/libc/stdio/fvwrite.h @@ -1,4 +1,4 @@ -/* $OpenBSD: fvwrite.h,v 1.6 2013/11/12 07:04:35 deraadt Exp $ */ +/* $OpenBSD: fvwrite.h,v 1.7 2015/08/27 04:37:09 guenther Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -45,5 +45,7 @@ struct __suio { int uio_resid; }; +__BEGIN_HIDDEN_DECLS extern int __sfvwrite(FILE *, struct __suio *); wint_t __fputwc_unlock(wchar_t wc, FILE *fp); +__END_HIDDEN_DECLS diff --git a/lib/libc/stdio/glue.h b/lib/libc/stdio/glue.h index 73cef63273b..530a70e6d1a 100644 --- a/lib/libc/stdio/glue.h +++ b/lib/libc/stdio/glue.h @@ -1,4 +1,4 @@ -/* $OpenBSD: glue.h,v 1.4 2004/01/11 21:39:51 millert Exp $ */ +/* $OpenBSD: glue.h,v 1.5 2015/08/27 04:37:09 guenther Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -42,4 +42,6 @@ struct glue { FILE *iobs; }; +__BEGIN_HIDDEN_DECLS extern struct glue __sglue; +__END_HIDDEN_DECLS diff --git a/lib/libc/stdio/local.h b/lib/libc/stdio/local.h index 0ebe1158116..56cdf22d9f1 100644 --- a/lib/libc/stdio/local.h +++ b/lib/libc/stdio/local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: local.h,v 1.20 2011/11/08 18:30:42 guenther Exp $ */ +/* $OpenBSD: local.h,v 1.21 2015/08/27 04:37:09 guenther Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,6 +41,12 @@ #include "wcio.h" #include "fileext.h" +void _cleanup(void); +int _fwalk(int (*)(FILE *)); + +extern void __atexit_register_cleanup(void (*)(void)); + +__BEGIN_HIDDEN_DECLS int __sflush(FILE *); int __sflush_locked(FILE *); FILE *__sfp(void); @@ -50,10 +56,8 @@ int __swrite(void *, const char *, int); fpos_t __sseek(void *, fpos_t, int); int __sclose(void *); void __sinit(void); -void _cleanup(void); void __smakebuf(FILE *); int __swhatbuf(FILE *, size_t *, int *); -int _fwalk(int (*)(FILE *)); int __swsetup(FILE *); int __sflags(const char *, int *); wint_t __fgetwc_unlock(FILE *); @@ -63,8 +67,8 @@ int __svfscanf(FILE * __restrict, const char * __restrict, __va_list); int __vfwprintf(FILE * __restrict, const wchar_t * __restrict, __va_list); int __vfwscanf(FILE * __restrict, const wchar_t * __restrict, __va_list); -extern void __atexit_register_cleanup(void (*)(void)); extern int __sdidinit; +__END_HIDDEN_DECLS /* * Return true if the given FILE cannot be written now. |