summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/_assert.h (renamed from src/nonstd/ASSERT_REPRESENTABLE.c)32
-rw-r--r--src/_nonstd.h (renamed from src/nonstd/LIBC_INTERNAL.c)7
-rw-r--r--src/ctype/_ctype.h2
-rw-r--r--src/ctype/isalnum.c2
-rw-r--r--src/ctype/isalpha.c2
-rw-r--r--src/ctype/isblank.c2
-rw-r--r--src/ctype/iscntrl.c2
-rw-r--r--src/ctype/isdigit.c2
-rw-r--r--src/ctype/isgraph.c2
-rw-r--r--src/ctype/islower.c2
-rw-r--r--src/ctype/isprint.c2
-rw-r--r--src/ctype/ispunct.c2
-rw-r--r--src/ctype/isspace.c2
-rw-r--r--src/ctype/isupper.c2
-rw-r--r--src/ctype/isxdigit.c2
-rw-r--r--src/ctype/tolower.c2
-rw-r--r--src/ctype/toupper.c2
-rw-r--r--src/errno/__errno.c2
-rw-r--r--src/fnmatch/fnmatch.c2
-rw-r--r--src/glob/glob.c2
-rw-r--r--src/locale/__load_locale.c (renamed from src/nonstd/_locale.h)16
-rw-r--r--src/locale/_locale.h (renamed from src/nonstd/struct_locale_t.c)10
-rw-r--r--src/locale/localeconv.c3
-rw-r--r--src/locale/setlocale.c3
-rw-r--r--src/nonstd/ASSERT_NONNULL.c14
-rw-r--r--src/nonstd/ASSERT_NONZERO.c14
-rw-r--r--src/nonstd/ASSERT_NOOVERLAP.c9
-rw-r--r--src/nonstd/__libc.c10
-rw-r--r--src/nonstd/__libc_per_thread.c4
-rw-r--r--src/nonstd/__load_locale.c4
-rw-r--r--src/nonstd/locale-internal.ref2
-rw-r--r--src/nonstd/locale-limits.ref2
-rw-r--r--src/nonstd/locale-locale.ref2
-rw-r--r--src/stdio/__stdio.c5
-rw-r--r--src/stdio/feof.c2
-rw-r--r--src/stdio/ferror.c2
-rw-r--r--src/stdio/fileno.c2
-rw-r--r--src/stdio/popen.c2
-rw-r--r--src/stdio/setvbuf.c12
-rw-r--r--src/string/memchr.c2
-rw-r--r--src/string/memcmp.c2
-rw-r--r--src/string/memcpy.c2
-rw-r--r--src/string/memmove.c2
-rw-r--r--src/string/memset.c2
-rw-r--r--src/string/strcat.c9
-rw-r--r--src/string/strchr.c2
-rw-r--r--src/string/strcmp.c2
-rw-r--r--src/string/strcoll.c2
-rw-r--r--src/string/strcpy.c2
-rw-r--r--src/string/strcspn.c2
-rw-r--r--src/string/strlen.c2
-rw-r--r--src/string/strncat.c2
-rw-r--r--src/string/strncmp.c2
-rw-r--r--src/string/strncpy.c2
-rw-r--r--src/string/strpbrk.c2
-rw-r--r--src/string/strrchr.c2
-rw-r--r--src/string/strspn.c2
-rw-r--r--src/string/strstr.c2
-rw-r--r--src/string/strtok.c2
-rw-r--r--src/string/strxfrm.c2
-rw-r--r--src/sys/stat/stat.c2
-rw-r--r--src/sys/utsname/uname.c2
-rw-r--r--src/termios/cfgetispeed.c2
-rw-r--r--src/termios/cfgetospeed.c2
-rw-r--r--src/termios/cfsetispeed.c2
-rw-r--r--src/termios/cfsetospeed.c2
-rw-r--r--src/time/gmtime.c2
-rw-r--r--src/time/localtime.c2
-rw-r--r--src/time/strftime.c5
-rw-r--r--src/unistd/confstr.c2
-rw-r--r--src/unistd/getcwd.c2
-rw-r--r--src/unistd/getgroups.c2
-rw-r--r--src/unistd/pipe.c2
-rw-r--r--src/unistd/unlink.c2
-rw-r--r--src/unistd/write.c2
-rw-r--r--src/wchar/fgetwc.c1
-rw-r--r--src/wchar/fgetws.c2
-rw-r--r--src/wchar/fwide.c2
-rw-r--r--src/wchar/wcscmp.c2
-rw-r--r--src/wchar/wcscspn.c2
-rw-r--r--src/wchar/wcsncmp.c2
-rw-r--r--src/wchar/wmemchr.c2
-rw-r--r--src/wchar/wmemmove.c2
-rw-r--r--src/wctype/iswalnum.c2
-rw-r--r--src/wctype/iswalpha.c2
-rw-r--r--src/wctype/iswblank.c2
-rw-r--r--src/wctype/iswcntrl.c2
-rw-r--r--src/wctype/iswctype.c2
-rw-r--r--src/wctype/iswdigit.c2
-rw-r--r--src/wctype/iswgraph.c2
-rw-r--r--src/wctype/iswlower.c2
-rw-r--r--src/wctype/iswprint.c2
-rw-r--r--src/wctype/iswpunct.c2
-rw-r--r--src/wctype/iswspace.c2
-rw-r--r--src/wctype/iswupper.c2
-rw-r--r--src/wctype/iswxdigit.c2
-rw-r--r--src/wctype/towctrans.c2
-rw-r--r--src/wctype/towlower.c2
-rw-r--r--src/wctype/towupper.c2
-rw-r--r--src/wctype/wctrans.c2
-rw-r--r--src/wctype/wctype.c2
101 files changed, 170 insertions, 156 deletions
diff --git a/src/nonstd/ASSERT_REPRESENTABLE.c b/src/_assert.h
index 0067d9b4..2d27edfb 100644
--- a/src/nonstd/ASSERT_REPRESENTABLE.c
+++ b/src/_assert.h
@@ -1,6 +1,29 @@
-#include <nonstd/assert.h>
+#ifndef ___ASSERT_H__
+#define ___ASSERT_H__
#ifndef NDEBUG
+#define ASSERT_NONNULL(__ptr) do { \
+ if (!__ptr) { \
+ struct __constraint_info _ci = {0}; \
+ _ci.func = __func__; \
+ __libc.stdlib.constraint_handler("Undefined behavior: " \
+ "Parameter " #__ptr " can not be NULL", &_ci, EFAULT); \
+ } \
+} while (0)
+
+#define ASSERT_NONZERO(__n) do { \
+ if (!__n) { \
+ struct __constraint_info _ci = {0}; \
+ _ci.func = __func__; \
+ __libc.stdlib.constraint_handler("Undefined behavior: " \
+ "Parameter " #__n " can not be 0", &_ci, ERANGE); \
+ } \
+} while (0)
+
+#define ASSERT_NOOVERLAP(__x, __y, __s) do { \
+ /* TODO */ \
+} while (0)
+
#define ASSERT_REPRESENTABLE(_n, _min, _max, _type, _sentinel) do { \
if (_sentinel && (_n != _sentinel && (_n < _min || _n > _max))) { \
struct __constraint_info _ci = {0}; \
@@ -17,5 +40,12 @@
} \
} while (0)
#else
+
#define ASSERT_REPRESENTABLE(_n, _min, _max, _type, _sentinel)
+#define ASSERT_NOOVERLAP(__x, __y, __s)
+#define ASSERT_NONNULL(x)
+#define ASSERT_NONZERO(n)
+
+#endif
+
#endif
diff --git a/src/nonstd/LIBC_INTERNAL.c b/src/_nonstd.h
index a00a0c98..247579cd 100644
--- a/src/nonstd/LIBC_INTERNAL.c
+++ b/src/_nonstd.h
@@ -1,4 +1,5 @@
-#include <nonstd/internal.h>
+#ifndef ___NONSTD_H__
+#define ___NONSTD_H__
typedef enum {
/* errno.h */
@@ -15,3 +16,7 @@ typedef enum {
TOLOWER,
TOUPPER,
} LIBC_INTERNAL;
+
+void *__libc(LIBC_INTERNAL __variable);
+
+#endif
diff --git a/src/ctype/_ctype.h b/src/ctype/_ctype.h
index fa584da6..f64553c1 100644
--- a/src/ctype/_ctype.h
+++ b/src/ctype/_ctype.h
@@ -1,7 +1,7 @@
#ifndef ___CTYPE_H__
#define ___CTYPE_H__
-#include "nonstd/internal.h"
+#include "../_nonstd.h"
typedef enum {
CT_ALPHA = (1 << 0),
diff --git a/src/ctype/isalnum.c b/src/ctype/isalnum.c
index 6b0d7388..67ade0a2 100644
--- a/src/ctype/isalnum.c
+++ b/src/ctype/isalnum.c
@@ -1,6 +1,6 @@
#include <ctype.h>
#include "limits.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** test whether a character is alphanumeric **/
diff --git a/src/ctype/isalpha.c b/src/ctype/isalpha.c
index c399dc1c..b87817c8 100644
--- a/src/ctype/isalpha.c
+++ b/src/ctype/isalpha.c
@@ -1,6 +1,6 @@
#include <ctype.h>
#include "limits.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** test whether a character is alphabetic **/
diff --git a/src/ctype/isblank.c b/src/ctype/isblank.c
index aed70f98..d22d2315 100644
--- a/src/ctype/isblank.c
+++ b/src/ctype/isblank.c
@@ -2,7 +2,7 @@
#include "limits.h"
#include "locale.h"
#include "_ctype.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** test whether a character is blank **/
diff --git a/src/ctype/iscntrl.c b/src/ctype/iscntrl.c
index 679d3d24..ef28ff20 100644
--- a/src/ctype/iscntrl.c
+++ b/src/ctype/iscntrl.c
@@ -1,6 +1,6 @@
#include <ctype.h>
#include "limits.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
#include "_ctype.h"
/** test whether a character is a control character */
diff --git a/src/ctype/isdigit.c b/src/ctype/isdigit.c
index f4f80c1b..0f91a7d3 100644
--- a/src/ctype/isdigit.c
+++ b/src/ctype/isdigit.c
@@ -1,6 +1,6 @@
#include <ctype.h>
#include "limits.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** test whether a character is a digit **/
diff --git a/src/ctype/isgraph.c b/src/ctype/isgraph.c
index d041e840..a6490d8f 100644
--- a/src/ctype/isgraph.c
+++ b/src/ctype/isgraph.c
@@ -1,6 +1,6 @@
#include <ctype.h>
#include "limits.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
#include "_ctype.h"
/** test whether a character is graphic **/
diff --git a/src/ctype/islower.c b/src/ctype/islower.c
index b2e0b678..35c8236d 100644
--- a/src/ctype/islower.c
+++ b/src/ctype/islower.c
@@ -1,6 +1,6 @@
#include <ctype.h>
#include "limits.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
#include "_ctype.h"
/** test whether a character is a lowercase letter **/
diff --git a/src/ctype/isprint.c b/src/ctype/isprint.c
index 4a426fe1..c3deaebd 100644
--- a/src/ctype/isprint.c
+++ b/src/ctype/isprint.c
@@ -1,6 +1,6 @@
#include <ctype.h>
#include "limits.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
#include "_ctype.h"
/** test whether a character is printable **/
diff --git a/src/ctype/ispunct.c b/src/ctype/ispunct.c
index e55dac2e..12d0cf16 100644
--- a/src/ctype/ispunct.c
+++ b/src/ctype/ispunct.c
@@ -1,6 +1,6 @@
#include <ctype.h>
#include "limits.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
#include "_ctype.h"
/** test whether a character is punctuation **/
diff --git a/src/ctype/isspace.c b/src/ctype/isspace.c
index 16cb0c24..fb913c49 100644
--- a/src/ctype/isspace.c
+++ b/src/ctype/isspace.c
@@ -1,6 +1,6 @@
#include <ctype.h>
#include "limits.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
#include "_ctype.h"
/** test whether a character is white-space **/
diff --git a/src/ctype/isupper.c b/src/ctype/isupper.c
index d0d58eaa..ff07ff59 100644
--- a/src/ctype/isupper.c
+++ b/src/ctype/isupper.c
@@ -1,6 +1,6 @@
#include <ctype.h>
#include "limits.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
#include "_ctype.h"
/** test whether a character is an uppercase letter **/
diff --git a/src/ctype/isxdigit.c b/src/ctype/isxdigit.c
index 543774a3..9f9e0b91 100644
--- a/src/ctype/isxdigit.c
+++ b/src/ctype/isxdigit.c
@@ -1,6 +1,6 @@
#include <ctype.h>
#include "limits.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
#include "_ctype.h"
/** test whether a character is a hexadecimal digit **/
diff --git a/src/ctype/tolower.c b/src/ctype/tolower.c
index 0994071b..4512ef36 100644
--- a/src/ctype/tolower.c
+++ b/src/ctype/tolower.c
@@ -1,7 +1,7 @@
#include <ctype.h>
#include "stdio.h"
#include "limits.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
#include "_ctype.h"
/** convert an uppercase letter to lowercase **/
diff --git a/src/ctype/toupper.c b/src/ctype/toupper.c
index e40e4a73..897d059e 100644
--- a/src/ctype/toupper.c
+++ b/src/ctype/toupper.c
@@ -1,7 +1,7 @@
#include <ctype.h>
#include "stdio.h"
#include "limits.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
#include "_ctype.h"
/** convert a lowercase letter to uppercase **/
diff --git a/src/errno/__errno.c b/src/errno/__errno.c
index c46c86c7..99061185 100644
--- a/src/errno/__errno.c
+++ b/src/errno/__errno.c
@@ -1,5 +1,5 @@
#include <errno.h>
-#include "nonstd/internal.h"
+#include "../_nonstd.h"
int *__errno(void)
{
diff --git a/src/fnmatch/fnmatch.c b/src/fnmatch/fnmatch.c
index 2f330951..97c17071 100644
--- a/src/fnmatch/fnmatch.c
+++ b/src/fnmatch/fnmatch.c
@@ -1,5 +1,5 @@
#include <fnmatch.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
int fnmatch(const char * pattern, const char * string, int flags)
{
diff --git a/src/glob/glob.c b/src/glob/glob.c
index e3b7525f..153f8046 100644
--- a/src/glob/glob.c
+++ b/src/glob/glob.c
@@ -6,7 +6,7 @@
#include "fnmatch.h"
#include "errno.h"
#include "unistd.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
int glob(const char * restrict pattern, int flags, int (*errfunc) (const char * epath, int eerrno), glob_t * restrict pglob)
{
diff --git a/src/nonstd/_locale.h b/src/locale/__load_locale.c
index be692e87..d79bb4e4 100644
--- a/src/nonstd/_locale.h
+++ b/src/locale/__load_locale.c
@@ -1,9 +1,9 @@
-#include <locale.h>
-#include <limits.h>
-#include <stdio.h>
-#include <string.h>
+#include "locale.h"
+#include "limits.h"
+#include "stdio.h"
+#include "string.h"
-#include "nonstd/locale.h"
+#include "_locale.h"
#include "../ctype/_ctype.h"
#define LC_COLLATE_MASK (1<<0)
@@ -21,7 +21,7 @@
} \
} while (0)
-static char * (__load_locale)(struct __locale_t *loc, int mask, const char *name)
+char * __load_locale(struct __locale_t *loc, int mask, const char *name)
{
if (name == NULL) {
name = "";
@@ -233,3 +233,7 @@ static char * (__load_locale)(struct __locale_t *loc, int mask, const char *name
return (char*)name;
}
+
+/*
+STDC(0)
+*/
diff --git a/src/nonstd/struct_locale_t.c b/src/locale/_locale.h
index 3479e22f..bed7e0f5 100644
--- a/src/nonstd/struct_locale_t.c
+++ b/src/locale/_locale.h
@@ -1,4 +1,8 @@
-#include <nonstd/locale.h>
+#ifndef ___LOCALE_H__
+#define ___LOCALE_H__
+
+#include <locale.h>
+#include <limits.h>
struct __locale_t {
char all[UCHAR_MAX];
@@ -55,3 +59,7 @@ struct __locale_t {
char *alt_digits;
} lc_time;
};
+
+char * __load_locale(struct __locale_t *, int, const char *);
+
+#endif
diff --git a/src/locale/localeconv.c b/src/locale/localeconv.c
index f08eb872..e63402e2 100644
--- a/src/locale/localeconv.c
+++ b/src/locale/localeconv.c
@@ -1,5 +1,6 @@
#include <locale.h>
-#include "nonstd/locale.h"
+#include "_locale.h"
+#include "../_nonstd.h"
/** return locale-specific information **/
struct lconv * localeconv(void)
diff --git a/src/locale/setlocale.c b/src/locale/setlocale.c
index 56043e61..068bf858 100644
--- a/src/locale/setlocale.c
+++ b/src/locale/setlocale.c
@@ -1,7 +1,8 @@
#include <locale.h>
#include "string.h"
#include "stdlib.h"
-#include "nonstd/locale.h"
+#include "_locale.h"
+#include "../_nonstd.h"
#include "LC_ALL_MASK.c"
#include "LC_COLLATE_MASK.c"
diff --git a/src/nonstd/ASSERT_NONNULL.c b/src/nonstd/ASSERT_NONNULL.c
deleted file mode 100644
index 26a6138e..00000000
--- a/src/nonstd/ASSERT_NONNULL.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <nonstd/assert.h>
-
-#ifndef NDEBUG
-#define ASSERT_NONNULL(__ptr) do { \
- if (!__ptr) { \
- struct __constraint_info _ci = {0}; \
- _ci.func = __func__; \
- __libc.stdlib.constraint_handler("Undefined behavior: " \
- "Parameter " #__ptr " can not be NULL", &_ci, EFAULT); \
- } \
- } while (0)
-#else
-#define ASSERT_NONNULL(x)
-#endif
diff --git a/src/nonstd/ASSERT_NONZERO.c b/src/nonstd/ASSERT_NONZERO.c
deleted file mode 100644
index e48e775a..00000000
--- a/src/nonstd/ASSERT_NONZERO.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <nonstd/assert.h>
-
-#ifndef NDEBUG
-#define ASSERT_NONZERO(__n) do { \
- if (!__n) { \
- struct __constraint_info _ci = {0}; \
- _ci.func = __func__; \
- __libc.stdlib.constraint_handler("Undefined behavior: " \
- "Parameter " #__n " can not be 0", &_ci, ERANGE); \
- } \
- } while (0)
-#else
-#define ASSERT_NONZERO(n)
-#endif
diff --git a/src/nonstd/ASSERT_NOOVERLAP.c b/src/nonstd/ASSERT_NOOVERLAP.c
deleted file mode 100644
index 7173752d..00000000
--- a/src/nonstd/ASSERT_NOOVERLAP.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <nonstd/assert.h>
-
-#ifndef NDEBUG
-#define ASSERT_NOOVERLAP(__x, __y, __s) do { \
- /* TODO */ \
- } while (0)
-#else
-#define ASSERT_NOOVERLAP(__x, __y, __s)
-#endif
diff --git a/src/nonstd/__libc.c b/src/nonstd/__libc.c
index 752dcab0..9000dd46 100644
--- a/src/nonstd/__libc.c
+++ b/src/nonstd/__libc.c
@@ -1,10 +1,8 @@
#include "sys/types.h"
-#include <nonstd/internal.h>
-#include "nonstd/locale.h"
+#include "../_nonstd.h"
+#include "../locale/_locale.h"
#include "../stdio/_stdio.h"
-#include "_locale.h"
-
void *__libc(LIBC_INTERNAL variable)
{
extern void *__libc_per_thread(LIBC_INTERNAL __variable);
@@ -59,10 +57,6 @@ void *__libc(LIBC_INTERNAL variable)
r = &(((struct __locale_t*)r)->mn);
break;
- case LOAD_LOCALE:
- r = (void*)(__load_locale);
- break;
-
default:
break;
}
diff --git a/src/nonstd/__libc_per_thread.c b/src/nonstd/__libc_per_thread.c
index 15156c6e..38c7c610 100644
--- a/src/nonstd/__libc_per_thread.c
+++ b/src/nonstd/__libc_per_thread.c
@@ -1,6 +1,6 @@
-#include "nonstd/internal.h"
+#include "../_nonstd.h"
#include "locale.h"
-#include "nonstd/locale.h"
+#include "../locale/_locale.h"
#if defined __STDC_VERSION__ && 201112L <= __STDC_VERSION__ && !defined __STDC_NO_THREADS__
#define THREAD_LOCAL static _Thread_local
diff --git a/src/nonstd/__load_locale.c b/src/nonstd/__load_locale.c
deleted file mode 100644
index 2233e6b8..00000000
--- a/src/nonstd/__load_locale.c
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <nonstd/locale.h>
-
-#define __load_locale(_loc, _mask, _name) \
- ((char * (*)(struct __locale_t *, int, const char *))__libc(LOAD_LOCALE))(_loc, _mask, _name)
diff --git a/src/nonstd/locale-internal.ref b/src/nonstd/locale-internal.ref
deleted file mode 100644
index d795ee8f..00000000
--- a/src/nonstd/locale-internal.ref
+++ /dev/null
@@ -1,2 +0,0 @@
-#include <nonstd/locale.h>
-REFERENCE(<nonstd/internal.h>)
diff --git a/src/nonstd/locale-limits.ref b/src/nonstd/locale-limits.ref
deleted file mode 100644
index 705296b4..00000000
--- a/src/nonstd/locale-limits.ref
+++ /dev/null
@@ -1,2 +0,0 @@
-#include <nonstd/locale.h>
-REFERENCE(<limits.h>)
diff --git a/src/nonstd/locale-locale.ref b/src/nonstd/locale-locale.ref
deleted file mode 100644
index 98478b9f..00000000
--- a/src/nonstd/locale-locale.ref
+++ /dev/null
@@ -1,2 +0,0 @@
-#include <nonstd/locale.h>
-REFERENCE(<locale.h>)
diff --git a/src/stdio/__stdio.c b/src/stdio/__stdio.c
index d607bde6..2360020f 100644
--- a/src/stdio/__stdio.c
+++ b/src/stdio/__stdio.c
@@ -1,2 +1,7 @@
#include "_stdio.h"
+
struct __stdio __stdio;
+
+/*
+STDC(0)
+*/
diff --git a/src/stdio/feof.c b/src/stdio/feof.c
index 9524d8c6..8b2455bd 100644
--- a/src/stdio/feof.c
+++ b/src/stdio/feof.c
@@ -1,6 +1,6 @@
#include <stdio.h>
#include "_stdio.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** test for end-of-file **/
int feof(FILE *stream)
diff --git a/src/stdio/ferror.c b/src/stdio/ferror.c
index 9d427e1f..d4e014d4 100644
--- a/src/stdio/ferror.c
+++ b/src/stdio/ferror.c
@@ -1,5 +1,5 @@
#include <stdio.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
#include "_stdio.h"
/** tests the file stream error indicator **/
diff --git a/src/stdio/fileno.c b/src/stdio/fileno.c
index 8292001d..969f572c 100644
--- a/src/stdio/fileno.c
+++ b/src/stdio/fileno.c
@@ -1,6 +1,6 @@
#include <stdio.h>
#include "_stdio.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
int fileno(FILE * stream)
{
diff --git a/src/stdio/popen.c b/src/stdio/popen.c
index 04918003..0e0fc663 100644
--- a/src/stdio/popen.c
+++ b/src/stdio/popen.c
@@ -5,7 +5,7 @@
#include "sys/types.h"
#include "unistd.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
#include "_stdio.h"
#ifdef __STDC_VERSION__
diff --git a/src/stdio/setvbuf.c b/src/stdio/setvbuf.c
index e5800288..ecf038fd 100644
--- a/src/stdio/setvbuf.c
+++ b/src/stdio/setvbuf.c
@@ -16,11 +16,19 @@ int setvbuf(FILE *stream, char *buf, int mode, size_t size)
stream->buffering = mode;
stream->bsize = size;
+ if (mode == _IONBF) {
+ /* maybe free buffer */
+ return 0;
+ }
+
if (buf != NULL) {
stream->buf = buf;
stream->buftype = SUPPLIED;
- } else if (mode != _IONBF) {
- stream->buf = calloc(size, sizeof(char));
+ } else if (size <= BUFSIZ) {
+ stream->buf = stream->ibuf;
+ stream->buftype = INTERNAL;
+ } else {
+ stream->buf = malloc(size);
stream->buftype = ALLOCED;
}
diff --git a/src/string/memchr.c b/src/string/memchr.c
index 97f6b257..9b795e9b 100644
--- a/src/string/memchr.c
+++ b/src/string/memchr.c
@@ -1,5 +1,5 @@
#include <string.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** search memory **/
void * memchr(const void *s, int c, size_t n)
diff --git a/src/string/memcmp.c b/src/string/memcmp.c
index 64dcb464..f0c1e2da 100644
--- a/src/string/memcmp.c
+++ b/src/string/memcmp.c
@@ -1,5 +1,5 @@
#include <string.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** compare memory regions **/
int memcmp(const void *s1, const void *s2, size_t n)
diff --git a/src/string/memcpy.c b/src/string/memcpy.c
index f53fe5d8..43ac292e 100644
--- a/src/string/memcpy.c
+++ b/src/string/memcpy.c
@@ -1,5 +1,5 @@
#include <string.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** copy memory **/
void * memcpy(void * restrict s1, const void * restrict s2, size_t n)
diff --git a/src/string/memmove.c b/src/string/memmove.c
index 33000e0e..ec8e785d 100644
--- a/src/string/memmove.c
+++ b/src/string/memmove.c
@@ -1,5 +1,5 @@
#include <string.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** move memory **/
void * memmove(void *s1, const void *s2, size_t n)
diff --git a/src/string/memset.c b/src/string/memset.c
index 1f3d14ff..2fdb8551 100644
--- a/src/string/memset.c
+++ b/src/string/memset.c
@@ -1,5 +1,5 @@
#include <string.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** fill memory **/
void * memset(void *s, int c, size_t n)
diff --git a/src/string/strcat.c b/src/string/strcat.c
index 9526cd59..75364ad3 100644
--- a/src/string/strcat.c
+++ b/src/string/strcat.c
@@ -1,9 +1,10 @@
#include <string.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** concatenate strings **/
char * strcat(char * restrict s1, const char * restrict s2)
{
+ size_t i = 0;
ASSERT_NONNULL(s1);
ASSERT_NONNULL(s2);
ASSERT_NOOVERLAP(s1, s2, strlen(s1) + strlen(s2));
@@ -11,7 +12,11 @@ char * strcat(char * restrict s1, const char * restrict s2)
/*
RETURN_ALWAYS(ARGUMENT(s1));
*/
- return strncat(s1, s2, strlen(s2));
+ while (s1[i] != '\0') {
+ i++;
+ }
+
+ return strcpy(s1 + i, s2);
}
/***
diff --git a/src/string/strchr.c b/src/string/strchr.c
index 874db9be..2ee80c9b 100644
--- a/src/string/strchr.c
+++ b/src/string/strchr.c
@@ -1,5 +1,5 @@
#include <string.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** string search **/
char * strchr(const char *s, int c)
diff --git a/src/string/strcmp.c b/src/string/strcmp.c
index ed089c77..fdceeb67 100644
--- a/src/string/strcmp.c
+++ b/src/string/strcmp.c
@@ -1,5 +1,5 @@
#include <string.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** compare strings **/
int strcmp(const char *s1, const char *s2)
diff --git a/src/string/strcoll.c b/src/string/strcoll.c
index 8707ba73..afdf868e 100644
--- a/src/string/strcoll.c
+++ b/src/string/strcoll.c
@@ -1,6 +1,6 @@
#include <string.h>
#include "stdlib.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** collate strings **/
int strcoll(const char *s1, const char *s2)
diff --git a/src/string/strcpy.c b/src/string/strcpy.c
index cf4eeb21..915701d9 100644
--- a/src/string/strcpy.c
+++ b/src/string/strcpy.c
@@ -1,5 +1,5 @@
#include <string.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** copy string **/
char * strcpy(char * restrict s1, const char * restrict s2)
diff --git a/src/string/strcspn.c b/src/string/strcspn.c
index 4bbdee2e..5ae42e04 100644
--- a/src/string/strcspn.c
+++ b/src/string/strcspn.c
@@ -1,5 +1,5 @@
#include <string.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** count non-matching characters **/
size_t strcspn(const char *s1, const char *s2)
diff --git a/src/string/strlen.c b/src/string/strlen.c
index 89ccbfcc..3405b252 100644
--- a/src/string/strlen.c
+++ b/src/string/strlen.c
@@ -1,5 +1,5 @@
#include <string.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** find string length **/
size_t strlen(const char *s)
diff --git a/src/string/strncat.c b/src/string/strncat.c
index 34800069..17ed6b40 100644
--- a/src/string/strncat.c
+++ b/src/string/strncat.c
@@ -1,5 +1,5 @@
#include <string.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** concatenate bounded string **/
char * strncat(char * restrict s1, const char * restrict s2, size_t n)
diff --git a/src/string/strncmp.c b/src/string/strncmp.c
index 23c8104e..f5647d33 100644
--- a/src/string/strncmp.c
+++ b/src/string/strncmp.c
@@ -1,5 +1,5 @@
#include <string.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** compare bound strings **/
int strncmp(const char *s1, const char *s2, size_t n)
diff --git a/src/string/strncpy.c b/src/string/strncpy.c
index ee632d69..290d36c3 100644
--- a/src/string/strncpy.c
+++ b/src/string/strncpy.c
@@ -1,5 +1,5 @@
#include <string.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** copy bounded string **/
char * strncpy(char * restrict s1, const char * restrict s2, size_t n)
diff --git a/src/string/strpbrk.c b/src/string/strpbrk.c
index 0b88b999..e5dfc52d 100644
--- a/src/string/strpbrk.c
+++ b/src/string/strpbrk.c
@@ -1,5 +1,5 @@
#include <string.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** count matching characters **/
char * strpbrk(const char *s1, const char *s2)
diff --git a/src/string/strrchr.c b/src/string/strrchr.c
index 0427aa66..fe40c5db 100644
--- a/src/string/strrchr.c
+++ b/src/string/strrchr.c
@@ -1,5 +1,5 @@
#include <string.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** search string from end **/
char * strrchr(const char *s, int c)
diff --git a/src/string/strspn.c b/src/string/strspn.c
index e67461a5..677d43c2 100644
--- a/src/string/strspn.c
+++ b/src/string/strspn.c
@@ -1,5 +1,5 @@
#include <string.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** count matching characters **/
size_t strspn(const char *s1, const char *s2)
diff --git a/src/string/strstr.c b/src/string/strstr.c
index 898db1be..7aaad5ad 100644
--- a/src/string/strstr.c
+++ b/src/string/strstr.c
@@ -1,5 +1,5 @@
#include <string.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** search for substring **/
char * strstr(const char *s1, const char *s2)
diff --git a/src/string/strtok.c b/src/string/strtok.c
index ed44e9f2..b4d77305 100644
--- a/src/string/strtok.c
+++ b/src/string/strtok.c
@@ -1,5 +1,5 @@
#include <string.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** split string into tokens **/
char * strtok(char * restrict s1, const char * restrict s2)
diff --git a/src/string/strxfrm.c b/src/string/strxfrm.c
index b6ec62b6..4c640a26 100644
--- a/src/string/strxfrm.c
+++ b/src/string/strxfrm.c
@@ -1,5 +1,5 @@
#include <string.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** transform string **/
size_t strxfrm(char * restrict s1, const char * restrict s2, size_t n)
diff --git a/src/sys/stat/stat.c b/src/sys/stat/stat.c
index c5079295..2c2d02d2 100644
--- a/src/sys/stat/stat.c
+++ b/src/sys/stat/stat.c
@@ -1,7 +1,7 @@
#include "sys/types.h"
#include <sys/stat.h>
#include "stdlib.h"
-#include "nonstd/assert.h"
+#include "../../_assert.h"
int stat(const char * restrict path, struct stat * restrict buf)
{
diff --git a/src/sys/utsname/uname.c b/src/sys/utsname/uname.c
index 50b53e11..e5a4b83e 100644
--- a/src/sys/utsname/uname.c
+++ b/src/sys/utsname/uname.c
@@ -1,6 +1,6 @@
#include <sys/utsname.h>
#include "string.h"
-#include "nonstd/assert.h"
+#include "../../_assert.h"
# define __PLATFORM__ "x86"
diff --git a/src/termios/cfgetispeed.c b/src/termios/cfgetispeed.c
index d7fd9aa1..6ba31775 100644
--- a/src/termios/cfgetispeed.c
+++ b/src/termios/cfgetispeed.c
@@ -1,5 +1,5 @@
#include <termios.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
speed_t cfgetispeed(const struct termios *termios_p)
{
diff --git a/src/termios/cfgetospeed.c b/src/termios/cfgetospeed.c
index 870f6b35..7ccab1f2 100644
--- a/src/termios/cfgetospeed.c
+++ b/src/termios/cfgetospeed.c
@@ -1,5 +1,5 @@
#include <termios.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
speed_t cfgetospeed(const struct termios *termios_p)
{
diff --git a/src/termios/cfsetispeed.c b/src/termios/cfsetispeed.c
index f2452171..3fbf0836 100644
--- a/src/termios/cfsetispeed.c
+++ b/src/termios/cfsetispeed.c
@@ -1,6 +1,6 @@
#include <termios.h>
#include "errno.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
int cfsetispeed(struct termios *termios_p, speed_t speed)
{
diff --git a/src/termios/cfsetospeed.c b/src/termios/cfsetospeed.c
index af99a0bb..62558b08 100644
--- a/src/termios/cfsetospeed.c
+++ b/src/termios/cfsetospeed.c
@@ -1,6 +1,6 @@
#include <termios.h>
#include "errno.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
int cfsetospeed(struct termios *termios_p, speed_t speed)
{
diff --git a/src/time/gmtime.c b/src/time/gmtime.c
index a844d097..a193fb99 100644
--- a/src/time/gmtime.c
+++ b/src/time/gmtime.c
@@ -1,5 +1,5 @@
#include <time.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
# define SEC_PER_MIN (60L)
# define MIN_PER_HR (60L)
diff --git a/src/time/localtime.c b/src/time/localtime.c
index b09f84a5..80ac9bfa 100644
--- a/src/time/localtime.c
+++ b/src/time/localtime.c
@@ -1,5 +1,5 @@
#include <time.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** convert arithmetic time to broken down time **/
diff --git a/src/time/strftime.c b/src/time/strftime.c
index 9d9f10e1..4d306789 100644
--- a/src/time/strftime.c
+++ b/src/time/strftime.c
@@ -1,8 +1,9 @@
#include <time.h>
#include "stdio.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
#include "locale.h"
-#include "nonstd/locale.h"
+#include "../locale/_locale.h"
+#include "../_nonstd.h"
/** convert time to a formatted string **/
diff --git a/src/unistd/confstr.c b/src/unistd/confstr.c
index 0cf00319..c6fd1523 100644
--- a/src/unistd/confstr.c
+++ b/src/unistd/confstr.c
@@ -2,7 +2,7 @@
#include <unistd.h>
#include "errno.h"
#include "string.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
size_t confstr(int name, char *buf, size_t len)
{
diff --git a/src/unistd/getcwd.c b/src/unistd/getcwd.c
index 7a37a7c2..61f9c573 100644
--- a/src/unistd/getcwd.c
+++ b/src/unistd/getcwd.c
@@ -1,6 +1,6 @@
#include "sys/types.h"
#include <unistd.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
#include "../_syscall.h"
char * getcwd(char *buf, size_t size)
diff --git a/src/unistd/getgroups.c b/src/unistd/getgroups.c
index b7df2896..5e7b3ff5 100644
--- a/src/unistd/getgroups.c
+++ b/src/unistd/getgroups.c
@@ -3,7 +3,7 @@
#include <unistd.h>
#include "errno.h"
#include "../_syscall.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
int getgroups(int gidsetsize, gid_t grouplist[])
{
diff --git a/src/unistd/pipe.c b/src/unistd/pipe.c
index 26e97dea..394b1846 100644
--- a/src/unistd/pipe.c
+++ b/src/unistd/pipe.c
@@ -1,7 +1,7 @@
#include "stddef.h"
#include "sys/types.h"
#include <unistd.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
#include "../_syscall.h"
int pipe(int fildes[2])
diff --git a/src/unistd/unlink.c b/src/unistd/unlink.c
index f658872d..0ce396bf 100644
--- a/src/unistd/unlink.c
+++ b/src/unistd/unlink.c
@@ -1,7 +1,7 @@
#include "stddef.h"
#include "sys/types.h"
#include <unistd.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
#include "../_syscall.h"
int unlink(const char *path)
diff --git a/src/unistd/write.c b/src/unistd/write.c
index 6982a359..a58bdc78 100644
--- a/src/unistd/write.c
+++ b/src/unistd/write.c
@@ -1,7 +1,7 @@
#include "stddef.h"
#include "sys/types.h"
#include <unistd.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
#include "../_syscall.h"
ssize_t write(int fildes, const void *buf, size_t nbyte)
diff --git a/src/wchar/fgetwc.c b/src/wchar/fgetwc.c
index e5bedd04..8d725b6e 100644
--- a/src/wchar/fgetwc.c
+++ b/src/wchar/fgetwc.c
@@ -5,7 +5,6 @@
#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 199506L
#include "../unistd/read.c"
-#include "../stdio/getc_unlocked.c"
#endif
wint_t fgetwc(FILE * stream)
diff --git a/src/wchar/fgetws.c b/src/wchar/fgetws.c
index 5262a79d..40d41cec 100644
--- a/src/wchar/fgetws.c
+++ b/src/wchar/fgetws.c
@@ -1,6 +1,6 @@
#include <wchar.h>
#include "stdio.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
wchar_t * fgetws(wchar_t * restrict s, int n, FILE * restrict stream)
{
diff --git a/src/wchar/fwide.c b/src/wchar/fwide.c
index 13c4d5f0..17da898b 100644
--- a/src/wchar/fwide.c
+++ b/src/wchar/fwide.c
@@ -1,7 +1,7 @@
#include <wchar.h>
#include "stdio.h"
#include "../stdio/_stdio.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
int fwide(FILE * stream, int mode)
{
diff --git a/src/wchar/wcscmp.c b/src/wchar/wcscmp.c
index d07d9a10..67ef7432 100644
--- a/src/wchar/wcscmp.c
+++ b/src/wchar/wcscmp.c
@@ -1,5 +1,5 @@
#include <wchar.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
int wcscmp(const wchar_t * s1, const wchar_t * s2)
{
diff --git a/src/wchar/wcscspn.c b/src/wchar/wcscspn.c
index 0c300a4a..1c4f5cf2 100644
--- a/src/wchar/wcscspn.c
+++ b/src/wchar/wcscspn.c
@@ -1,5 +1,5 @@
#include <wchar.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
size_t wcscspn(const wchar_t * s1, const wchar_t * s2)
{
diff --git a/src/wchar/wcsncmp.c b/src/wchar/wcsncmp.c
index d41899f4..06edf836 100644
--- a/src/wchar/wcsncmp.c
+++ b/src/wchar/wcsncmp.c
@@ -1,5 +1,5 @@
#include <wchar.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
int wcsncmp(const wchar_t * s1, const wchar_t * s2, size_t n)
{
diff --git a/src/wchar/wmemchr.c b/src/wchar/wmemchr.c
index b6d9ac7b..28ad085d 100644
--- a/src/wchar/wmemchr.c
+++ b/src/wchar/wmemchr.c
@@ -1,5 +1,5 @@
#include <wchar.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
wchar_t * wmemchr(const wchar_t * s, wchar_t c, size_t n)
{
diff --git a/src/wchar/wmemmove.c b/src/wchar/wmemmove.c
index 75b58f87..7667e3c4 100644
--- a/src/wchar/wmemmove.c
+++ b/src/wchar/wmemmove.c
@@ -1,6 +1,6 @@
#include <wchar.h>
#include "stdlib.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
wchar_t * wmemmove(wchar_t * s1, const wchar_t * s2, size_t n)
{
diff --git a/src/wctype/iswalnum.c b/src/wctype/iswalnum.c
index dafc242e..42f0df4a 100644
--- a/src/wctype/iswalnum.c
+++ b/src/wctype/iswalnum.c
@@ -1,6 +1,6 @@
#include <wctype.h>
#include "limits.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
#include "wchar.h"
/** test whether a wide character is alphanumeric **/
diff --git a/src/wctype/iswalpha.c b/src/wctype/iswalpha.c
index 6fcc275f..0d3e6d57 100644
--- a/src/wctype/iswalpha.c
+++ b/src/wctype/iswalpha.c
@@ -1,6 +1,6 @@
#include <wctype.h>
#include "wchar.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** test whether a wide character is alphabetic **/
int iswalpha(wint_t wc)
diff --git a/src/wctype/iswblank.c b/src/wctype/iswblank.c
index b6a44d3c..753f9b41 100644
--- a/src/wctype/iswblank.c
+++ b/src/wctype/iswblank.c
@@ -1,5 +1,5 @@
#include <wctype.h>
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** test whether a wide character is blank **/
int iswblank(wint_t wc)
diff --git a/src/wctype/iswcntrl.c b/src/wctype/iswcntrl.c
index 7859148a..acec5785 100644
--- a/src/wctype/iswcntrl.c
+++ b/src/wctype/iswcntrl.c
@@ -1,6 +1,6 @@
#include <wctype.h>
#include "wchar.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** test whether a wide character is a control character */
int iswcntrl(wint_t wc)
diff --git a/src/wctype/iswctype.c b/src/wctype/iswctype.c
index fd24051a..db05e919 100644
--- a/src/wctype/iswctype.c
+++ b/src/wctype/iswctype.c
@@ -1,6 +1,6 @@
#include <wctype.h>
#include "wchar.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** test whether a wide character is part of a character class **/
int iswctype(wint_t wc, wctype_t desc)
diff --git a/src/wctype/iswdigit.c b/src/wctype/iswdigit.c
index 1ccdf84d..7dc13755 100644
--- a/src/wctype/iswdigit.c
+++ b/src/wctype/iswdigit.c
@@ -1,6 +1,6 @@
#include <wctype.h>
#include "wchar.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** test whether a wide character is a digit **/
int iswdigit(wint_t wc)
diff --git a/src/wctype/iswgraph.c b/src/wctype/iswgraph.c
index f20ad02c..dba00813 100644
--- a/src/wctype/iswgraph.c
+++ b/src/wctype/iswgraph.c
@@ -1,6 +1,6 @@
#include <wctype.h>
#include "wchar.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** test whether a wide character is graphic **/
int iswgraph(wint_t wc)
diff --git a/src/wctype/iswlower.c b/src/wctype/iswlower.c
index 739c36e8..5bd19e2e 100644
--- a/src/wctype/iswlower.c
+++ b/src/wctype/iswlower.c
@@ -1,6 +1,6 @@
#include <wctype.h>
#include "wchar.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** test whether a character is a lowercase letter **/
int iswlower(wint_t wc)
diff --git a/src/wctype/iswprint.c b/src/wctype/iswprint.c
index 11bf9033..51730c5e 100644
--- a/src/wctype/iswprint.c
+++ b/src/wctype/iswprint.c
@@ -1,6 +1,6 @@
#include <wctype.h>
#include "wchar.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** test whether a wide character is printable **/
int iswprint(wint_t wc)
diff --git a/src/wctype/iswpunct.c b/src/wctype/iswpunct.c
index 5ffdbe85..5896f8bb 100644
--- a/src/wctype/iswpunct.c
+++ b/src/wctype/iswpunct.c
@@ -1,6 +1,6 @@
#include <wctype.h>
#include "wchar.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** test whether a wide character is punctuation **/
int iswpunct(wint_t wc)
diff --git a/src/wctype/iswspace.c b/src/wctype/iswspace.c
index 60bf723a..feb22b5e 100644
--- a/src/wctype/iswspace.c
+++ b/src/wctype/iswspace.c
@@ -1,6 +1,6 @@
#include <wctype.h>
#include "wchar.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** test whether a wide character is white-space **/
int iswspace(wint_t wc)
diff --git a/src/wctype/iswupper.c b/src/wctype/iswupper.c
index 27fe2359..b56e4214 100644
--- a/src/wctype/iswupper.c
+++ b/src/wctype/iswupper.c
@@ -1,6 +1,6 @@
#include <wctype.h>
#include "wchar.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** test whether a wide character is an uppercase letter **/
int iswupper(wint_t wc)
diff --git a/src/wctype/iswxdigit.c b/src/wctype/iswxdigit.c
index b544b285..2b255a40 100644
--- a/src/wctype/iswxdigit.c
+++ b/src/wctype/iswxdigit.c
@@ -1,6 +1,6 @@
#include <wctype.h>
#include "wchar.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** test whether a wide character is a hexadecimal digit **/
int iswxdigit(wint_t wc)
diff --git a/src/wctype/towctrans.c b/src/wctype/towctrans.c
index 9ea0c8a6..0b083cad 100644
--- a/src/wctype/towctrans.c
+++ b/src/wctype/towctrans.c
@@ -1,6 +1,6 @@
#include <wctype.h>
#include "wchar.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
wint_t towctrans(wint_t wc, wctrans_t desc)
{
diff --git a/src/wctype/towlower.c b/src/wctype/towlower.c
index 8e5254d8..fe0c632e 100644
--- a/src/wctype/towlower.c
+++ b/src/wctype/towlower.c
@@ -1,7 +1,7 @@
#include <wctype.h>
#include "wchar.h"
#include "stdlib.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** convert a wide uppercase letter to lowercase **/
wint_t towlower(wint_t wc)
diff --git a/src/wctype/towupper.c b/src/wctype/towupper.c
index 1310e109..0f1a40be 100644
--- a/src/wctype/towupper.c
+++ b/src/wctype/towupper.c
@@ -1,6 +1,6 @@
#include <wctype.h>
#include "wchar.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
/** convert a wide lowercase letter to uppercase **/
wint_t towupper(wint_t wc)
diff --git a/src/wctype/wctrans.c b/src/wctype/wctrans.c
index fac15545..4380467e 100644
--- a/src/wctype/wctrans.c
+++ b/src/wctype/wctrans.c
@@ -1,6 +1,6 @@
#include <wctype.h>
#include "string.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
#include "_wctype.h"
/** lookup character translation **/
diff --git a/src/wctype/wctype.c b/src/wctype/wctype.c
index 96e5dd1b..c2ec3460 100644
--- a/src/wctype/wctype.c
+++ b/src/wctype/wctype.c
@@ -1,6 +1,6 @@
#include <wctype.h>
#include "string.h"
-#include "nonstd/assert.h"
+#include "../_assert.h"
#include "_wctype.h"
/** lookup character class **/