summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-04-17 20:54:59 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2023-05-05 21:21:37 -0500
commit41735bdeff548ce44afe21aa21f1345047eb18e4 (patch)
treed820dc6d013a2ccf2df16c484d2e416668c35c4b
parent8e936ea931afa5b17e03c1fea7a17024b677263b (diff)
downloadmusl-41735bdeff548ce44afe21aa21f1345047eb18e4.tar.gz
musl-41735bdeff548ce44afe21aa21f1345047eb18e4.tar.bz2
musl-41735bdeff548ce44afe21aa21f1345047eb18e4.tar.xz
musl-41735bdeff548ce44afe21aa21f1345047eb18e4.zip
stdlib: Ensure C11 fns are only visible in C11
aligned_alloc, at_quick_exit, and quick_exit are new in C11 and C++11. Only make these symbols visible in those versions, to avoid polluting the namespace of C99 and POSIX 2008 sources.
-rw-r--r--include/stdlib.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/stdlib.h b/include/stdlib.h
index 1d0ee846..6ac26741 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -41,14 +41,18 @@ void *malloc (size_t);
void *calloc (size_t, size_t);
void *realloc (void *, size_t);
void free (void *);
+#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L || defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
void *aligned_alloc(size_t, size_t);
+#endif
_Noreturn void abort (void);
int atexit (void (*) (void));
_Noreturn void exit (int);
_Noreturn void _Exit (int);
+#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L || defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
int at_quick_exit (void (*) (void));
_Noreturn void quick_exit (int);
+#endif
char *getenv (const char *);