diff options
Diffstat (limited to 'libc/src/stdio')
170 files changed, 514 insertions, 339 deletions
diff --git a/libc/src/stdio/CMakeLists.txt b/libc/src/stdio/CMakeLists.txt index e5bf5c6..7c61238 100644 --- a/libc/src/stdio/CMakeLists.txt +++ b/libc/src/stdio/CMakeLists.txt @@ -209,7 +209,6 @@ add_entrypoint_object( libc.src.stdio.printf_core.vfprintf_internal ) - add_subdirectory(printf_core) add_subdirectory(scanf_core) diff --git a/libc/src/stdio/baremetal/getchar.cpp b/libc/src/stdio/baremetal/getchar.cpp index 01a5a58..0a78a1f 100644 --- a/libc/src/stdio/baremetal/getchar.cpp +++ b/libc/src/stdio/baremetal/getchar.cpp @@ -8,10 +8,11 @@ #include "src/stdio/getchar.h" #include "src/__support/OSUtil/io.h" +#include "src/__support/macros/config.h" #include "hdr/stdio_macros.h" // for EOF. -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, getchar, ()) { char buf[1]; @@ -21,4 +22,4 @@ LLVM_LIBC_FUNCTION(int, getchar, ()) { return buf[0]; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/baremetal/printf.cpp b/libc/src/stdio/baremetal/printf.cpp index dfc3c0b..04aa284 100644 --- a/libc/src/stdio/baremetal/printf.cpp +++ b/libc/src/stdio/baremetal/printf.cpp @@ -9,6 +9,7 @@ #include "src/stdio/printf.h" #include "src/__support/OSUtil/io.h" #include "src/__support/arg_list.h" +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/core_structs.h" #include "src/stdio/printf_core/printf_main.h" #include "src/stdio/printf_core/writer.h" @@ -16,7 +17,7 @@ #include <stdarg.h> #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace { @@ -49,4 +50,4 @@ LLVM_LIBC_FUNCTION(int, printf, (const char *__restrict format, ...)) { return retval; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/baremetal/putchar.cpp b/libc/src/stdio/baremetal/putchar.cpp index 23e9745..0ba46a5 100644 --- a/libc/src/stdio/baremetal/putchar.cpp +++ b/libc/src/stdio/baremetal/putchar.cpp @@ -9,8 +9,9 @@ #include "src/stdio/putchar.h" #include "src/__support/CPP/string_view.h" #include "src/__support/OSUtil/io.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, putchar, (int c)) { char uc = static_cast<char>(c); @@ -20,4 +21,4 @@ LLVM_LIBC_FUNCTION(int, putchar, (int c)) { return 0; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/baremetal/puts.cpp b/libc/src/stdio/baremetal/puts.cpp index 136cdb8..5062efd 100644 --- a/libc/src/stdio/baremetal/puts.cpp +++ b/libc/src/stdio/baremetal/puts.cpp @@ -9,8 +9,9 @@ #include "src/stdio/puts.h" #include "src/__support/CPP/string_view.h" #include "src/__support/OSUtil/io.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, puts, (const char *__restrict str)) { cpp::string_view str_view(str); @@ -22,4 +23,4 @@ LLVM_LIBC_FUNCTION(int, puts, (const char *__restrict str)) { return 0; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/baremetal/remove.cpp b/libc/src/stdio/baremetal/remove.cpp index f4f2cdc..d383d0c 100644 --- a/libc/src/stdio/baremetal/remove.cpp +++ b/libc/src/stdio/baremetal/remove.cpp @@ -9,11 +9,12 @@ #include "src/stdio/remove.h" #include "src/__support/common.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { // TODO: This is a temporary workaround for issue #85335. LLVM_LIBC_FUNCTION(int, remove, (const char *)) { return -1; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/baremetal/vprintf.cpp b/libc/src/stdio/baremetal/vprintf.cpp index 203ec18..617b5f4 100644 --- a/libc/src/stdio/baremetal/vprintf.cpp +++ b/libc/src/stdio/baremetal/vprintf.cpp @@ -9,6 +9,7 @@ #include "src/stdio/vprintf.h" #include "src/__support/OSUtil/io.h" #include "src/__support/arg_list.h" +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/core_structs.h" #include "src/stdio/printf_core/printf_main.h" #include "src/stdio/printf_core/writer.h" @@ -16,7 +17,7 @@ #include <stdarg.h> #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace { @@ -47,4 +48,4 @@ LLVM_LIBC_FUNCTION(int, vprintf, return retval; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/clearerr.h b/libc/src/stdio/clearerr.h index 2b34180..790d923 100644 --- a/libc/src/stdio/clearerr.h +++ b/libc/src/stdio/clearerr.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_CLEARERR_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { void clearerr(::FILE *stream); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_CLEARERR_H diff --git a/libc/src/stdio/clearerr_unlocked.h b/libc/src/stdio/clearerr_unlocked.h index 05ddbdd..2a57e76 100644 --- a/libc/src/stdio/clearerr_unlocked.h +++ b/libc/src/stdio/clearerr_unlocked.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_CLEARERR_UNLOCKED_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { void clearerr_unlocked(::FILE *stream); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_CLEARERR_UNLOCKED_H diff --git a/libc/src/stdio/fclose.h b/libc/src/stdio/fclose.h index 731e358..0b1a36d 100644 --- a/libc/src/stdio/fclose.h +++ b/libc/src/stdio/fclose.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_FCLOSE_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int fclose(::FILE *stream); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FCLOSE_H diff --git a/libc/src/stdio/fdopen.h b/libc/src/stdio/fdopen.h index 29028b8..9917c2b 100644 --- a/libc/src/stdio/fdopen.h +++ b/libc/src/stdio/fdopen.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_FDOPEN_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { ::FILE *fdopen(int fd, const char *mode); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FDOPEN_H diff --git a/libc/src/stdio/feof.h b/libc/src/stdio/feof.h index 3d47db6..6a88d3b 100644 --- a/libc/src/stdio/feof.h +++ b/libc/src/stdio/feof.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_FEOF_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int feof(::FILE *stream); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FEOF_H diff --git a/libc/src/stdio/feof_unlocked.h b/libc/src/stdio/feof_unlocked.h index 6eae427..0c14439 100644 --- a/libc/src/stdio/feof_unlocked.h +++ b/libc/src/stdio/feof_unlocked.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_FEOF_UNLOCKED_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int feof_unlocked(::FILE *stream); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FEOF_UNLOCKED_H diff --git a/libc/src/stdio/ferror.h b/libc/src/stdio/ferror.h index 9e2f949..d613c37 100644 --- a/libc/src/stdio/ferror.h +++ b/libc/src/stdio/ferror.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_FERROR_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int ferror(::FILE *stream); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FERROR_H diff --git a/libc/src/stdio/ferror_unlocked.h b/libc/src/stdio/ferror_unlocked.h index 16cfd5a..13cfd23 100644 --- a/libc/src/stdio/ferror_unlocked.h +++ b/libc/src/stdio/ferror_unlocked.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_FERROR_UNLOCKED_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int ferror_unlocked(::FILE *stream); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FERROR_UNLOCKED_H diff --git a/libc/src/stdio/fflush.h b/libc/src/stdio/fflush.h index d64d526..e810484 100644 --- a/libc/src/stdio/fflush.h +++ b/libc/src/stdio/fflush.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_FFLUSH_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int fflush(::FILE *stream); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FFLUSH_H diff --git a/libc/src/stdio/fgetc.h b/libc/src/stdio/fgetc.h index f88d759..f17a88a 100644 --- a/libc/src/stdio/fgetc.h +++ b/libc/src/stdio/fgetc.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_FGETC_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int fgetc(::FILE *f); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FGETC_H diff --git a/libc/src/stdio/fgetc_unlocked.h b/libc/src/stdio/fgetc_unlocked.h index 9ff311a..5643ee2 100644 --- a/libc/src/stdio/fgetc_unlocked.h +++ b/libc/src/stdio/fgetc_unlocked.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_FGETC_UNLOCKED_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int fgetc_unlocked(::FILE *f); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FGETC_UNLOCKED_H diff --git a/libc/src/stdio/fgets.h b/libc/src/stdio/fgets.h index d3d49a1..499c27c 100644 --- a/libc/src/stdio/fgets.h +++ b/libc/src/stdio/fgets.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_FGETS_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { char *fgets(char *__restrict str, int count, ::FILE *__restrict raw_stream); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FGETS_H diff --git a/libc/src/stdio/fileno.h b/libc/src/stdio/fileno.h index 667061a..7e49e71 100644 --- a/libc/src/stdio/fileno.h +++ b/libc/src/stdio/fileno.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_FILENO_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int fileno(::FILE *f); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FILENO_H diff --git a/libc/src/stdio/flockfile.cpp b/libc/src/stdio/flockfile.cpp index b996a77..4fc0af5 100644 --- a/libc/src/stdio/flockfile.cpp +++ b/libc/src/stdio/flockfile.cpp @@ -8,13 +8,14 @@ #include "src/stdio/flockfile.h" #include "src/__support/File/file.h" +#include "src/__support/macros/config.h" #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(void, flockfile, (::FILE * stream)) { reinterpret_cast<LIBC_NAMESPACE::File *>(stream)->lock(); } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/flockfile.h b/libc/src/stdio/flockfile.h index ef00265..b7e2b5f 100644 --- a/libc/src/stdio/flockfile.h +++ b/libc/src/stdio/flockfile.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_FLOCKFILE_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { void flockfile(::FILE *stream); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FLOCKFILE_H diff --git a/libc/src/stdio/fopen.h b/libc/src/stdio/fopen.h index 23f95cf..a76c3a9 100644 --- a/libc/src/stdio/fopen.h +++ b/libc/src/stdio/fopen.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_FOPEN_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { ::FILE *fopen(const char *__restrict name, const char *__restrict mode); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FOPEN_H diff --git a/libc/src/stdio/fopencookie.cpp b/libc/src/stdio/fopencookie.cpp index 367172a..07be9a5 100644 --- a/libc/src/stdio/fopencookie.cpp +++ b/libc/src/stdio/fopencookie.cpp @@ -14,9 +14,10 @@ #include "src/__support/CPP/new.h" #include "src/__support/File/file.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace { @@ -97,4 +98,4 @@ LLVM_LIBC_FUNCTION(::FILE *, fopencookie, return reinterpret_cast<::FILE *>(file); } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/fopencookie.h b/libc/src/stdio/fopencookie.h index dc83212..15b377f 100644 --- a/libc/src/stdio/fopencookie.h +++ b/libc/src/stdio/fopencookie.h @@ -11,12 +11,13 @@ #include "hdr/types/FILE.h" #include "hdr/types/cookie_io_functions_t.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { ::FILE *fopencookie(void *cookie, const char *__restrict mode, cookie_io_functions_t desc); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FOPENCOOKIE_H diff --git a/libc/src/stdio/fprintf.cpp b/libc/src/stdio/fprintf.cpp index 5d14d82..087aead 100644 --- a/libc/src/stdio/fprintf.cpp +++ b/libc/src/stdio/fprintf.cpp @@ -10,12 +10,13 @@ #include "src/__support/File/file.h" #include "src/__support/arg_list.h" +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/vfprintf_internal.h" #include "hdr/types/FILE.h" #include <stdarg.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, fprintf, (::FILE *__restrict stream, const char *__restrict format, @@ -30,4 +31,4 @@ LLVM_LIBC_FUNCTION(int, fprintf, return ret_val; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/fprintf.h b/libc/src/stdio/fprintf.h index 4d070ce..4ab90e3 100644 --- a/libc/src/stdio/fprintf.h +++ b/libc/src/stdio/fprintf.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_FPRINTF_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int fprintf(::FILE *__restrict stream, const char *__restrict format, ...); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FPRINTF_H diff --git a/libc/src/stdio/fputc.h b/libc/src/stdio/fputc.h index 6c44965..5dde302 100644 --- a/libc/src/stdio/fputc.h +++ b/libc/src/stdio/fputc.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_FPUTC_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int fputc(int c, ::FILE *stream); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FPUTC_H diff --git a/libc/src/stdio/fputs.h b/libc/src/stdio/fputs.h index 4dddf96..4b5534f 100644 --- a/libc/src/stdio/fputs.h +++ b/libc/src/stdio/fputs.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_FPUTS_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int fputs(const char *__restrict str, ::FILE *__restrict stream); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FPUTS_H diff --git a/libc/src/stdio/fread.h b/libc/src/stdio/fread.h index a74095a..ab11af3 100644 --- a/libc/src/stdio/fread.h +++ b/libc/src/stdio/fread.h @@ -10,13 +10,14 @@ #define LLVM_LIBC_SRC_STDIO_FREAD_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { size_t fread(void *__restrict buffer, size_t size, size_t nmemb, ::FILE *stream); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FREAD_H diff --git a/libc/src/stdio/fread_unlocked.h b/libc/src/stdio/fread_unlocked.h index 49a3827..ff5561e 100644 --- a/libc/src/stdio/fread_unlocked.h +++ b/libc/src/stdio/fread_unlocked.h @@ -10,13 +10,14 @@ #define LLVM_LIBC_SRC_STDIO_FREAD_UNLOCKED_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { size_t fread_unlocked(void *__restrict buffer, size_t size, size_t nmemb, ::FILE *stream); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FREAD_UNLOCKED_H diff --git a/libc/src/stdio/fscanf.cpp b/libc/src/stdio/fscanf.cpp index 1f99f87..94b8439 100644 --- a/libc/src/stdio/fscanf.cpp +++ b/libc/src/stdio/fscanf.cpp @@ -10,12 +10,13 @@ #include "src/__support/File/file.h" #include "src/__support/arg_list.h" +#include "src/__support/macros/config.h" #include "src/stdio/scanf_core/vfscanf_internal.h" #include "hdr/types/FILE.h" #include <stdarg.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, fscanf, (::FILE *__restrict stream, const char *__restrict format, @@ -32,4 +33,4 @@ LLVM_LIBC_FUNCTION(int, fscanf, return (ret_val == -1) ? EOF : ret_val; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/fscanf.h b/libc/src/stdio/fscanf.h index 21df616..3a8b86b 100644 --- a/libc/src/stdio/fscanf.h +++ b/libc/src/stdio/fscanf.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_FSCANF_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int fscanf(::FILE *__restrict stream, const char *__restrict format, ...); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FSCANF_H diff --git a/libc/src/stdio/fseek.h b/libc/src/stdio/fseek.h index 5496cbe..a979b41 100644 --- a/libc/src/stdio/fseek.h +++ b/libc/src/stdio/fseek.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_FSEEK_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int fseek(::FILE *stream, long offset, int whence); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FSEEK_H diff --git a/libc/src/stdio/fseeko.h b/libc/src/stdio/fseeko.h index 25fc39e..6b83d4a 100644 --- a/libc/src/stdio/fseeko.h +++ b/libc/src/stdio/fseeko.h @@ -11,11 +11,12 @@ #include "hdr/types/FILE.h" #include "hdr/types/off_t.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int fseeko(::FILE *stream, off_t offset, int whence); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FSEEKO_H diff --git a/libc/src/stdio/ftell.h b/libc/src/stdio/ftell.h index b644edd..813d9a1 100644 --- a/libc/src/stdio/ftell.h +++ b/libc/src/stdio/ftell.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_FTELL_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { long ftell(::FILE *f); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FTELL_H diff --git a/libc/src/stdio/ftello.h b/libc/src/stdio/ftello.h index fc00b6a..92732d5 100644 --- a/libc/src/stdio/ftello.h +++ b/libc/src/stdio/ftello.h @@ -11,11 +11,12 @@ #include "hdr/types/FILE.h" #include "hdr/types/off_t.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { off_t ftello(::FILE *f); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FTELLO_H diff --git a/libc/src/stdio/funlockfile.cpp b/libc/src/stdio/funlockfile.cpp index 404b232..7a0712a 100644 --- a/libc/src/stdio/funlockfile.cpp +++ b/libc/src/stdio/funlockfile.cpp @@ -8,13 +8,14 @@ #include "src/stdio/funlockfile.h" #include "src/__support/File/file.h" +#include "src/__support/macros/config.h" #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(void, funlockfile, (::FILE * stream)) { reinterpret_cast<LIBC_NAMESPACE::File *>(stream)->unlock(); } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/funlockfile.h b/libc/src/stdio/funlockfile.h index 65b77dd..0949ca0 100644 --- a/libc/src/stdio/funlockfile.h +++ b/libc/src/stdio/funlockfile.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_FUNLOCKFILE_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { void funlockfile(::FILE *stream); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FUNLOCKFILE_H diff --git a/libc/src/stdio/fwrite.h b/libc/src/stdio/fwrite.h index c153298..8ba5e4d 100644 --- a/libc/src/stdio/fwrite.h +++ b/libc/src/stdio/fwrite.h @@ -10,13 +10,14 @@ #define LLVM_LIBC_SRC_STDIO_FWRITE_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { size_t fwrite(const void *__restrict ptr, size_t size, size_t nmemb, ::FILE *__restrict stream); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FWRITE_H diff --git a/libc/src/stdio/fwrite_unlocked.h b/libc/src/stdio/fwrite_unlocked.h index c1a02af..5ee6d38 100644 --- a/libc/src/stdio/fwrite_unlocked.h +++ b/libc/src/stdio/fwrite_unlocked.h @@ -10,13 +10,14 @@ #define LLVM_LIBC_SRC_STDIO_FWRITE_UNLOCKED_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { size_t fwrite_unlocked(const void *__restrict ptr, size_t size, size_t nmemb, ::FILE *__restrict stream); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_FWRITE_UNLOCKED_H diff --git a/libc/src/stdio/generic/clearerr.cpp b/libc/src/stdio/generic/clearerr.cpp index 11a2da1..583181a 100644 --- a/libc/src/stdio/generic/clearerr.cpp +++ b/libc/src/stdio/generic/clearerr.cpp @@ -8,13 +8,14 @@ #include "src/stdio/clearerr.h" #include "src/__support/File/file.h" +#include "src/__support/macros/config.h" #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(void, clearerr, (::FILE * stream)) { reinterpret_cast<LIBC_NAMESPACE::File *>(stream)->clearerr(); } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/clearerr_unlocked.cpp b/libc/src/stdio/generic/clearerr_unlocked.cpp index 86caa7b..313604c 100644 --- a/libc/src/stdio/generic/clearerr_unlocked.cpp +++ b/libc/src/stdio/generic/clearerr_unlocked.cpp @@ -8,13 +8,14 @@ #include "src/stdio/clearerr_unlocked.h" #include "src/__support/File/file.h" +#include "src/__support/macros/config.h" #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(void, clearerr_unlocked, (::FILE * stream)) { reinterpret_cast<LIBC_NAMESPACE::File *>(stream)->clearerr_unlocked(); } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/fclose.cpp b/libc/src/stdio/generic/fclose.cpp index 50ef17c..388407a 100644 --- a/libc/src/stdio/generic/fclose.cpp +++ b/libc/src/stdio/generic/fclose.cpp @@ -10,9 +10,10 @@ #include "src/__support/File/file.h" #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, fclose, (::FILE * stream)) { int result = reinterpret_cast<LIBC_NAMESPACE::File *>(stream)->close(); @@ -23,4 +24,4 @@ LLVM_LIBC_FUNCTION(int, fclose, (::FILE * stream)) { return 0; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/feof.cpp b/libc/src/stdio/generic/feof.cpp index 77df40e..8c7d195 100644 --- a/libc/src/stdio/generic/feof.cpp +++ b/libc/src/stdio/generic/feof.cpp @@ -8,13 +8,14 @@ #include "src/stdio/feof.h" #include "src/__support/File/file.h" +#include "src/__support/macros/config.h" #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, feof, (::FILE * stream)) { return reinterpret_cast<LIBC_NAMESPACE::File *>(stream)->iseof(); } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/feof_unlocked.cpp b/libc/src/stdio/generic/feof_unlocked.cpp index 0dcefaf..0ce827b 100644 --- a/libc/src/stdio/generic/feof_unlocked.cpp +++ b/libc/src/stdio/generic/feof_unlocked.cpp @@ -8,13 +8,14 @@ #include "src/stdio/feof_unlocked.h" #include "src/__support/File/file.h" +#include "src/__support/macros/config.h" #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, feof_unlocked, (::FILE * stream)) { return reinterpret_cast<LIBC_NAMESPACE::File *>(stream)->iseof_unlocked(); } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/ferror.cpp b/libc/src/stdio/generic/ferror.cpp index 66128fd..33e778e 100644 --- a/libc/src/stdio/generic/ferror.cpp +++ b/libc/src/stdio/generic/ferror.cpp @@ -8,13 +8,14 @@ #include "src/stdio/ferror.h" #include "src/__support/File/file.h" +#include "src/__support/macros/config.h" #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, ferror, (::FILE * stream)) { return reinterpret_cast<LIBC_NAMESPACE::File *>(stream)->error(); } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/ferror_unlocked.cpp b/libc/src/stdio/generic/ferror_unlocked.cpp index 76a4e255..f567f05 100644 --- a/libc/src/stdio/generic/ferror_unlocked.cpp +++ b/libc/src/stdio/generic/ferror_unlocked.cpp @@ -8,13 +8,14 @@ #include "src/stdio/ferror_unlocked.h" #include "src/__support/File/file.h" +#include "src/__support/macros/config.h" #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, ferror_unlocked, (::FILE * stream)) { return reinterpret_cast<LIBC_NAMESPACE::File *>(stream)->error_unlocked(); } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/fflush.cpp b/libc/src/stdio/generic/fflush.cpp index 670dda0..5bdf71a 100644 --- a/libc/src/stdio/generic/fflush.cpp +++ b/libc/src/stdio/generic/fflush.cpp @@ -10,9 +10,10 @@ #include "src/__support/File/file.h" #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, fflush, (::FILE * stream)) { int result = reinterpret_cast<LIBC_NAMESPACE::File *>(stream)->flush(); @@ -23,4 +24,4 @@ LLVM_LIBC_FUNCTION(int, fflush, (::FILE * stream)) { return 0; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/fgetc.cpp b/libc/src/stdio/generic/fgetc.cpp index 66afa64..aa6660c 100644 --- a/libc/src/stdio/generic/fgetc.cpp +++ b/libc/src/stdio/generic/fgetc.cpp @@ -10,10 +10,11 @@ #include "src/__support/File/file.h" #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, fgetc, (::FILE * stream)) { unsigned char c; @@ -27,4 +28,4 @@ LLVM_LIBC_FUNCTION(int, fgetc, (::FILE * stream)) { return c; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/fgetc_unlocked.cpp b/libc/src/stdio/generic/fgetc_unlocked.cpp index 7d67a94..34a27f1 100644 --- a/libc/src/stdio/generic/fgetc_unlocked.cpp +++ b/libc/src/stdio/generic/fgetc_unlocked.cpp @@ -10,10 +10,11 @@ #include "src/__support/File/file.h" #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, fgetc_unlocked, (::FILE * stream)) { unsigned char c; @@ -27,4 +28,4 @@ LLVM_LIBC_FUNCTION(int, fgetc_unlocked, (::FILE * stream)) { return c; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/fgets.cpp b/libc/src/stdio/generic/fgets.cpp index 121790b..de64740 100644 --- a/libc/src/stdio/generic/fgets.cpp +++ b/libc/src/stdio/generic/fgets.cpp @@ -10,10 +10,11 @@ #include "src/__support/File/file.h" #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(char *, fgets, (char *__restrict str, int count, @@ -52,4 +53,4 @@ LLVM_LIBC_FUNCTION(char *, fgets, return str; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/fileno.cpp b/libc/src/stdio/generic/fileno.cpp index 4ead752..0bec180 100644 --- a/libc/src/stdio/generic/fileno.cpp +++ b/libc/src/stdio/generic/fileno.cpp @@ -11,11 +11,12 @@ #include "hdr/types/FILE.h" #include "src/__support/File/file.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, fileno, (::FILE * stream)) { return get_fileno(reinterpret_cast<LIBC_NAMESPACE::File *>(stream)); } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/fopen.cpp b/libc/src/stdio/generic/fopen.cpp index 19cf3bc..d6e418b 100644 --- a/libc/src/stdio/generic/fopen.cpp +++ b/libc/src/stdio/generic/fopen.cpp @@ -10,9 +10,10 @@ #include "src/__support/File/file.h" #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(::FILE *, fopen, (const char *__restrict name, const char *__restrict mode)) { @@ -24,4 +25,4 @@ LLVM_LIBC_FUNCTION(::FILE *, fopen, return reinterpret_cast<::FILE *>(result.value()); } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/fputc.cpp b/libc/src/stdio/generic/fputc.cpp index 71d4bb8..54a38ae 100644 --- a/libc/src/stdio/generic/fputc.cpp +++ b/libc/src/stdio/generic/fputc.cpp @@ -10,10 +10,11 @@ #include "src/__support/File/file.h" #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, fputc, (int c, ::FILE *stream)) { unsigned char uc = static_cast<unsigned char>(c); @@ -30,4 +31,4 @@ LLVM_LIBC_FUNCTION(int, fputc, (int c, ::FILE *stream)) { return 0; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/fputs.cpp b/libc/src/stdio/generic/fputs.cpp index cefc6c6..8aef768 100644 --- a/libc/src/stdio/generic/fputs.cpp +++ b/libc/src/stdio/generic/fputs.cpp @@ -11,10 +11,11 @@ #include "src/__support/File/file.h" #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, fputs, (const char *__restrict str, ::FILE *__restrict stream)) { @@ -33,4 +34,4 @@ LLVM_LIBC_FUNCTION(int, fputs, return 0; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/fread.cpp b/libc/src/stdio/generic/fread.cpp index 986828b..3a04094e 100644 --- a/libc/src/stdio/generic/fread.cpp +++ b/libc/src/stdio/generic/fread.cpp @@ -10,10 +10,11 @@ #include "src/__support/File/file.h" #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(size_t, fread, (void *__restrict buffer, size_t size, size_t nmemb, @@ -27,4 +28,4 @@ LLVM_LIBC_FUNCTION(size_t, fread, return result.value / size; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/fread_unlocked.cpp b/libc/src/stdio/generic/fread_unlocked.cpp index 072503d..151f43c 100644 --- a/libc/src/stdio/generic/fread_unlocked.cpp +++ b/libc/src/stdio/generic/fread_unlocked.cpp @@ -10,10 +10,11 @@ #include "src/__support/File/file.h" #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(size_t, fread_unlocked, (void *__restrict buffer, size_t size, size_t nmemb, @@ -27,4 +28,4 @@ LLVM_LIBC_FUNCTION(size_t, fread_unlocked, return result.value / size; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/fseek.cpp b/libc/src/stdio/generic/fseek.cpp index c5edc8d..21820da 100644 --- a/libc/src/stdio/generic/fseek.cpp +++ b/libc/src/stdio/generic/fseek.cpp @@ -9,9 +9,10 @@ #include "src/stdio/fseek.h" #include "src/__support/File/file.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, fseek, (::FILE * stream, long offset, int whence)) { auto result = @@ -23,4 +24,4 @@ LLVM_LIBC_FUNCTION(int, fseek, (::FILE * stream, long offset, int whence)) { return 0; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/fseeko.cpp b/libc/src/stdio/generic/fseeko.cpp index 215da75..7456b4a 100644 --- a/libc/src/stdio/generic/fseeko.cpp +++ b/libc/src/stdio/generic/fseeko.cpp @@ -9,9 +9,10 @@ #include "src/stdio/fseeko.h" #include "src/__support/File/file.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, fseeko, (::FILE * stream, off_t offset, int whence)) { auto result = @@ -23,4 +24,4 @@ LLVM_LIBC_FUNCTION(int, fseeko, (::FILE * stream, off_t offset, int whence)) { return 0; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/ftell.cpp b/libc/src/stdio/generic/ftell.cpp index 16487ca..ec15ca4 100644 --- a/libc/src/stdio/generic/ftell.cpp +++ b/libc/src/stdio/generic/ftell.cpp @@ -9,9 +9,10 @@ #include "src/stdio/ftell.h" #include "src/__support/File/file.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(long, ftell, (::FILE * stream)) { auto result = reinterpret_cast<LIBC_NAMESPACE::File *>(stream)->tell(); @@ -26,4 +27,4 @@ LLVM_LIBC_FUNCTION(long, ftell, (::FILE * stream)) { return static_cast<long>(result.value()); } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/ftello.cpp b/libc/src/stdio/generic/ftello.cpp index c72e56e..e3d0726 100644 --- a/libc/src/stdio/generic/ftello.cpp +++ b/libc/src/stdio/generic/ftello.cpp @@ -9,9 +9,10 @@ #include "src/stdio/ftello.h" #include "src/__support/File/file.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(off_t, ftello, (::FILE * stream)) { auto result = reinterpret_cast<LIBC_NAMESPACE::File *>(stream)->tell(); @@ -22,4 +23,4 @@ LLVM_LIBC_FUNCTION(off_t, ftello, (::FILE * stream)) { return result.value(); } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/fwrite.cpp b/libc/src/stdio/generic/fwrite.cpp index 14c14f5..66eb9a3 100644 --- a/libc/src/stdio/generic/fwrite.cpp +++ b/libc/src/stdio/generic/fwrite.cpp @@ -10,10 +10,11 @@ #include "src/__support/File/file.h" #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(size_t, fwrite, (const void *__restrict buffer, size_t size, size_t nmemb, @@ -28,4 +29,4 @@ LLVM_LIBC_FUNCTION(size_t, fwrite, return result.value / size; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/fwrite_unlocked.cpp b/libc/src/stdio/generic/fwrite_unlocked.cpp index 0c76bd1..a0d9014c 100644 --- a/libc/src/stdio/generic/fwrite_unlocked.cpp +++ b/libc/src/stdio/generic/fwrite_unlocked.cpp @@ -10,10 +10,11 @@ #include "src/__support/File/file.h" #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(size_t, fwrite_unlocked, (const void *__restrict buffer, size_t size, size_t nmemb, @@ -30,4 +31,4 @@ LLVM_LIBC_FUNCTION(size_t, fwrite_unlocked, return result.value / size; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/getc.cpp b/libc/src/stdio/generic/getc.cpp index 20f3947..e988468 100644 --- a/libc/src/stdio/generic/getc.cpp +++ b/libc/src/stdio/generic/getc.cpp @@ -10,10 +10,11 @@ #include "src/__support/File/file.h" #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, getc, (::FILE * stream)) { unsigned char c; @@ -27,4 +28,4 @@ LLVM_LIBC_FUNCTION(int, getc, (::FILE * stream)) { return c; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/getc_unlocked.cpp b/libc/src/stdio/generic/getc_unlocked.cpp index 849d0be..92d5092 100644 --- a/libc/src/stdio/generic/getc_unlocked.cpp +++ b/libc/src/stdio/generic/getc_unlocked.cpp @@ -10,10 +10,11 @@ #include "src/__support/File/file.h" #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, getc_unlocked, (::FILE * stream)) { unsigned char c; @@ -28,4 +29,4 @@ LLVM_LIBC_FUNCTION(int, getc_unlocked, (::FILE * stream)) { return c; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/getchar.cpp b/libc/src/stdio/generic/getchar.cpp index bf3825b..371fc70 100644 --- a/libc/src/stdio/generic/getchar.cpp +++ b/libc/src/stdio/generic/getchar.cpp @@ -10,9 +10,10 @@ #include "src/__support/File/file.h" #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, getchar, ()) { unsigned char c; @@ -25,4 +26,4 @@ LLVM_LIBC_FUNCTION(int, getchar, ()) { return c; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/getchar_unlocked.cpp b/libc/src/stdio/generic/getchar_unlocked.cpp index 86777d1..b898f5c 100644 --- a/libc/src/stdio/generic/getchar_unlocked.cpp +++ b/libc/src/stdio/generic/getchar_unlocked.cpp @@ -10,9 +10,10 @@ #include "src/__support/File/file.h" #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, getchar_unlocked, ()) { unsigned char c; @@ -25,4 +26,4 @@ LLVM_LIBC_FUNCTION(int, getchar_unlocked, ()) { return c; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/printf.cpp b/libc/src/stdio/generic/printf.cpp index 14a4225..bb7c7c8 100644 --- a/libc/src/stdio/generic/printf.cpp +++ b/libc/src/stdio/generic/printf.cpp @@ -10,6 +10,7 @@ #include "src/__support/File/file.h" #include "src/__support/arg_list.h" +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/vfprintf_internal.h" #include "hdr/types/FILE.h" @@ -21,7 +22,7 @@ #define PRINTF_STDOUT ::stdout #endif // LIBC_COPT_STDIO_USE_SYSTEM_FILE -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, printf, (const char *__restrict format, ...)) { va_list vlist; @@ -35,4 +36,4 @@ LLVM_LIBC_FUNCTION(int, printf, (const char *__restrict format, ...)) { return ret_val; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/putc.cpp b/libc/src/stdio/generic/putc.cpp index e8ebbb3d..b5f008f 100644 --- a/libc/src/stdio/generic/putc.cpp +++ b/libc/src/stdio/generic/putc.cpp @@ -10,10 +10,11 @@ #include "src/__support/File/file.h" #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, putc, (int c, ::FILE *stream)) { unsigned char uc = static_cast<unsigned char>(c); @@ -30,4 +31,4 @@ LLVM_LIBC_FUNCTION(int, putc, (int c, ::FILE *stream)) { return 0; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/putchar.cpp b/libc/src/stdio/generic/putchar.cpp index e9e6f96..e86df23 100644 --- a/libc/src/stdio/generic/putchar.cpp +++ b/libc/src/stdio/generic/putchar.cpp @@ -10,10 +10,11 @@ #include "src/__support/File/file.h" #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, putchar, (int c)) { unsigned char uc = static_cast<unsigned char>(c); @@ -30,4 +31,4 @@ LLVM_LIBC_FUNCTION(int, putchar, (int c)) { return 0; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/puts.cpp b/libc/src/stdio/generic/puts.cpp index 247d4f0..7dbe2c79 100644 --- a/libc/src/stdio/generic/puts.cpp +++ b/libc/src/stdio/generic/puts.cpp @@ -11,10 +11,11 @@ #include "src/__support/File/file.h" #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace { @@ -54,4 +55,4 @@ LLVM_LIBC_FUNCTION(int, puts, (const char *__restrict str)) { return 0; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/ungetc.cpp b/libc/src/stdio/generic/ungetc.cpp index 8e2897e..44ffdfc 100644 --- a/libc/src/stdio/generic/ungetc.cpp +++ b/libc/src/stdio/generic/ungetc.cpp @@ -8,13 +8,14 @@ #include "src/stdio/ungetc.h" #include "src/__support/File/file.h" +#include "src/__support/macros/config.h" #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, ungetc, (int c, ::FILE *stream)) { return reinterpret_cast<LIBC_NAMESPACE::File *>(stream)->ungetc(c); } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/generic/vprintf.cpp b/libc/src/stdio/generic/vprintf.cpp index f78a84f..08d7151 100644 --- a/libc/src/stdio/generic/vprintf.cpp +++ b/libc/src/stdio/generic/vprintf.cpp @@ -10,6 +10,7 @@ #include "src/__support/File/file.h" #include "src/__support/arg_list.h" +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/vfprintf_internal.h" #include "hdr/types/FILE.h" @@ -21,7 +22,7 @@ #define PRINTF_STDOUT ::stdout #endif // LIBC_COPT_STDIO_USE_SYSTEM_FILE -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, vprintf, (const char *__restrict format, va_list vlist)) { @@ -33,4 +34,4 @@ LLVM_LIBC_FUNCTION(int, vprintf, return ret_val; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/getc.h b/libc/src/stdio/getc.h index 8567526..823f319 100644 --- a/libc/src/stdio/getc.h +++ b/libc/src/stdio/getc.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_GETC_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int getc(::FILE *f); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_GETC_H diff --git a/libc/src/stdio/getc_unlocked.h b/libc/src/stdio/getc_unlocked.h index 45dcb4e..2e0abac 100644 --- a/libc/src/stdio/getc_unlocked.h +++ b/libc/src/stdio/getc_unlocked.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_GETC_UNLOCKED_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int getc_unlocked(::FILE *f); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_GETC_UNLOCKED_H diff --git a/libc/src/stdio/getchar.h b/libc/src/stdio/getchar.h index 4168808..c9497fe 100644 --- a/libc/src/stdio/getchar.h +++ b/libc/src/stdio/getchar.h @@ -9,10 +9,12 @@ #ifndef LLVM_LIBC_SRC_STDIO_GETCHAR_H #define LLVM_LIBC_SRC_STDIO_GETCHAR_H -namespace LIBC_NAMESPACE { +#include "src/__support/macros/config.h" + +namespace LIBC_NAMESPACE_DECL { int getchar(); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_GETCHAR_H diff --git a/libc/src/stdio/getchar_unlocked.h b/libc/src/stdio/getchar_unlocked.h index 24fdb75..96fae85 100644 --- a/libc/src/stdio/getchar_unlocked.h +++ b/libc/src/stdio/getchar_unlocked.h @@ -9,10 +9,12 @@ #ifndef LLVM_LIBC_SRC_STDIO_GETCHAR_UNLOCKED_H #define LLVM_LIBC_SRC_STDIO_GETCHAR_UNLOCKED_H -namespace LIBC_NAMESPACE { +#include "src/__support/macros/config.h" + +namespace LIBC_NAMESPACE_DECL { int getchar_unlocked(); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_GETCHAR_UNLOCKED_H diff --git a/libc/src/stdio/gpu/clearerr.cpp b/libc/src/stdio/gpu/clearerr.cpp index ec7fe41..5826a7b 100644 --- a/libc/src/stdio/gpu/clearerr.cpp +++ b/libc/src/stdio/gpu/clearerr.cpp @@ -8,10 +8,11 @@ #include "src/stdio/clearerr.h" #include "file.h" +#include "src/__support/macros/config.h" #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(void, clearerr, (::FILE * stream)) { rpc::Client::Port port = rpc::client.open<RPC_CLEARERR>(); @@ -21,4 +22,4 @@ LLVM_LIBC_FUNCTION(void, clearerr, (::FILE * stream)) { port.close(); } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/gpu/fclose.cpp b/libc/src/stdio/gpu/fclose.cpp index 3bc68f1..78caccd 100644 --- a/libc/src/stdio/gpu/fclose.cpp +++ b/libc/src/stdio/gpu/fclose.cpp @@ -7,12 +7,13 @@ //===----------------------------------------------------------------------===// #include "src/stdio/fclose.h" +#include "src/__support/macros/config.h" #include "src/stdio/gpu/file.h" #include "hdr/stdio_macros.h" #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, fclose, (::FILE * stream)) { uint64_t ret = 0; @@ -27,4 +28,4 @@ LLVM_LIBC_FUNCTION(int, fclose, (::FILE * stream)) { return static_cast<int>(ret); } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/gpu/feof.cpp b/libc/src/stdio/gpu/feof.cpp index dee1e38..4a8a173 100644 --- a/libc/src/stdio/gpu/feof.cpp +++ b/libc/src/stdio/gpu/feof.cpp @@ -8,10 +8,11 @@ #include "src/stdio/feof.h" #include "file.h" +#include "src/__support/macros/config.h" #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, feof, (::FILE * stream)) { int ret; @@ -23,4 +24,4 @@ LLVM_LIBC_FUNCTION(int, feof, (::FILE * stream)) { return ret; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/gpu/ferror.cpp b/libc/src/stdio/gpu/ferror.cpp index 90e1592..1cee96f 100644 --- a/libc/src/stdio/gpu/ferror.cpp +++ b/libc/src/stdio/gpu/ferror.cpp @@ -8,10 +8,11 @@ #include "src/stdio/ferror.h" #include "file.h" +#include "src/__support/macros/config.h" #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, ferror, (::FILE * stream)) { int ret; @@ -23,4 +24,4 @@ LLVM_LIBC_FUNCTION(int, ferror, (::FILE * stream)) { return ret; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/gpu/fflush.cpp b/libc/src/stdio/gpu/fflush.cpp index 60c3522..be267a2 100644 --- a/libc/src/stdio/gpu/fflush.cpp +++ b/libc/src/stdio/gpu/fflush.cpp @@ -8,10 +8,11 @@ #include "src/stdio/fflush.h" #include "file.h" +#include "src/__support/macros/config.h" #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, fflush, (::FILE * stream)) { int ret; @@ -23,4 +24,4 @@ LLVM_LIBC_FUNCTION(int, fflush, (::FILE * stream)) { return ret; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/gpu/fgetc.cpp b/libc/src/stdio/gpu/fgetc.cpp index 08e6eb3..cb42f31 100644 --- a/libc/src/stdio/gpu/fgetc.cpp +++ b/libc/src/stdio/gpu/fgetc.cpp @@ -8,11 +8,12 @@ #include "src/stdio/fgetc.h" #include "file.h" +#include "src/__support/macros/config.h" #include "hdr/stdio_macros.h" // for EOF. #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, fgetc, (::FILE * stream)) { unsigned char c; @@ -23,4 +24,4 @@ LLVM_LIBC_FUNCTION(int, fgetc, (::FILE * stream)) { return c; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/gpu/fgets.cpp b/libc/src/stdio/gpu/fgets.cpp index fb0a30b..942f6f0 100644 --- a/libc/src/stdio/gpu/fgets.cpp +++ b/libc/src/stdio/gpu/fgets.cpp @@ -8,6 +8,7 @@ #include "src/stdio/fgets.h" #include "file.h" +#include "src/__support/macros/config.h" #include "src/stdio/feof.h" #include "src/stdio/ferror.h" @@ -15,7 +16,7 @@ #include "hdr/types/FILE.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(char *, fgets, (char *__restrict str, int count, @@ -40,4 +41,4 @@ LLVM_LIBC_FUNCTION(char *, fgets, return str; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/gpu/file.h b/libc/src/stdio/gpu/file.h index 8cbba9e..5de7684 100644 --- a/libc/src/stdio/gpu/file.h +++ b/libc/src/stdio/gpu/file.h @@ -7,13 +7,14 @@ //===----------------------------------------------------------------------===// #include "src/__support/RPC/rpc_client.h" +#include "src/__support/macros/config.h" #include "src/string/string_utils.h" #include "hdr/types/FILE.h" #include <stdio.h> //needed for stdin/out/err -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace file { enum Stream { @@ -96,4 +97,4 @@ LIBC_INLINE uint64_t read(::FILE *f, void *data, size_t size) { } } // namespace file -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/gpu/fopen.cpp b/libc/src/stdio/gpu/fopen.cpp index 1e55725..76daece 100644 --- a/libc/src/stdio/gpu/fopen.cpp +++ b/libc/src/stdio/gpu/fopen.cpp @@ -8,11 +8,12 @@ #include "src/stdio/fopen.h" #include "src/__support/CPP/string_view.h" +#include "src/__support/macros/config.h" #include "src/stdio/gpu/file.h" #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(::FILE *, fopen, (const char *__restrict path, const char *__restrict mode)) { @@ -29,4 +30,4 @@ LLVM_LIBC_FUNCTION(::FILE *, fopen, return reinterpret_cast<FILE *>(file); } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/gpu/fputc.cpp b/libc/src/stdio/gpu/fputc.cpp index a99eaeb..ad2db03 100644 --- a/libc/src/stdio/gpu/fputc.cpp +++ b/libc/src/stdio/gpu/fputc.cpp @@ -8,11 +8,12 @@ #include "src/stdio/fputc.h" #include "file.h" +#include "src/__support/macros/config.h" #include "hdr/stdio_macros.h" // for EOF. #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, fputc, (int c, ::FILE *stream)) { unsigned char uc = static_cast<unsigned char>(c); @@ -24,4 +25,4 @@ LLVM_LIBC_FUNCTION(int, fputc, (int c, ::FILE *stream)) { return 0; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/gpu/fputs.cpp b/libc/src/stdio/gpu/fputs.cpp index 4803da9..7a08244 100644 --- a/libc/src/stdio/gpu/fputs.cpp +++ b/libc/src/stdio/gpu/fputs.cpp @@ -8,13 +8,14 @@ #include "src/stdio/fputs.h" #include "src/__support/CPP/string_view.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" #include "src/stdio/gpu/file.h" #include "hdr/stdio_macros.h" // for EOF. #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, fputs, (const char *__restrict str, ::FILE *__restrict stream)) { @@ -25,4 +26,4 @@ LLVM_LIBC_FUNCTION(int, fputs, return 0; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/gpu/fread.cpp b/libc/src/stdio/gpu/fread.cpp index 233a780..57fa5b6 100644 --- a/libc/src/stdio/gpu/fread.cpp +++ b/libc/src/stdio/gpu/fread.cpp @@ -7,11 +7,12 @@ //===----------------------------------------------------------------------===// #include "src/stdio/fread.h" +#include "src/__support/macros/config.h" #include "src/stdio/gpu/file.h" #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(size_t, fread, (void *__restrict buffer, size_t size, size_t nmemb, @@ -22,4 +23,4 @@ LLVM_LIBC_FUNCTION(size_t, fread, return result / size; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/gpu/fseek.cpp b/libc/src/stdio/gpu/fseek.cpp index 3b1f85d..4f3e9ce 100644 --- a/libc/src/stdio/gpu/fseek.cpp +++ b/libc/src/stdio/gpu/fseek.cpp @@ -8,10 +8,11 @@ #include "src/stdio/fseek.h" #include "file.h" +#include "src/__support/macros/config.h" #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, fseek, (::FILE * stream, long offset, int whence)) { int ret; @@ -27,4 +28,4 @@ LLVM_LIBC_FUNCTION(int, fseek, (::FILE * stream, long offset, int whence)) { return ret; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/gpu/ftell.cpp b/libc/src/stdio/gpu/ftell.cpp index 5664726..483b1ad 100644 --- a/libc/src/stdio/gpu/ftell.cpp +++ b/libc/src/stdio/gpu/ftell.cpp @@ -8,10 +8,11 @@ #include "src/stdio/ftell.h" #include "file.h" +#include "src/__support/macros/config.h" #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(long, ftell, (::FILE * stream)) { long ret; @@ -23,4 +24,4 @@ LLVM_LIBC_FUNCTION(long, ftell, (::FILE * stream)) { return ret; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/gpu/fwrite.cpp b/libc/src/stdio/gpu/fwrite.cpp index 1321e32c..6c54869 100644 --- a/libc/src/stdio/gpu/fwrite.cpp +++ b/libc/src/stdio/gpu/fwrite.cpp @@ -8,10 +8,11 @@ #include "src/stdio/fwrite.h" #include "file.h" +#include "src/__support/macros/config.h" #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(size_t, fwrite, (const void *__restrict buffer, size_t size, size_t nmemb, @@ -23,4 +24,4 @@ LLVM_LIBC_FUNCTION(size_t, fwrite, return result / size; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/gpu/getc.cpp b/libc/src/stdio/gpu/getc.cpp index d77d8ba..9c32974 100644 --- a/libc/src/stdio/gpu/getc.cpp +++ b/libc/src/stdio/gpu/getc.cpp @@ -8,11 +8,12 @@ #include "src/stdio/getc.h" #include "file.h" +#include "src/__support/macros/config.h" #include "hdr/stdio_macros.h" // for EOF. #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, getc, (::FILE * stream)) { unsigned char c; @@ -23,4 +24,4 @@ LLVM_LIBC_FUNCTION(int, getc, (::FILE * stream)) { return c; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/gpu/getchar.cpp b/libc/src/stdio/gpu/getchar.cpp index 28e86da..048cf23 100644 --- a/libc/src/stdio/gpu/getchar.cpp +++ b/libc/src/stdio/gpu/getchar.cpp @@ -8,13 +8,14 @@ #include "src/stdio/getchar.h" #include "file.h" +#include "src/__support/macros/config.h" #include "hdr/stdio_macros.h" // for EOF. #include "hdr/types/FILE.h" #include <stdio.h> //needed for stdin -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, getchar, ()) { unsigned char c; @@ -25,4 +26,4 @@ LLVM_LIBC_FUNCTION(int, getchar, ()) { return c; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/gpu/putc.cpp b/libc/src/stdio/gpu/putc.cpp index d054d28..f8ae98d 100644 --- a/libc/src/stdio/gpu/putc.cpp +++ b/libc/src/stdio/gpu/putc.cpp @@ -8,11 +8,12 @@ #include "src/stdio/putc.h" #include "file.h" +#include "src/__support/macros/config.h" #include "hdr/stdio_macros.h" // for EOF. #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, putc, (int c, ::FILE *stream)) { unsigned char uc = static_cast<unsigned char>(c); @@ -24,4 +25,4 @@ LLVM_LIBC_FUNCTION(int, putc, (int c, ::FILE *stream)) { return 0; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/gpu/putchar.cpp b/libc/src/stdio/gpu/putchar.cpp index 3e38401..d03a3fe 100644 --- a/libc/src/stdio/gpu/putchar.cpp +++ b/libc/src/stdio/gpu/putchar.cpp @@ -8,13 +8,14 @@ #include "src/stdio/putchar.h" #include "file.h" +#include "src/__support/macros/config.h" #include "hdr/stdio_macros.h" // for EOF. #include "hdr/types/FILE.h" #include <stdio.h> //needed for stdout -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, putchar, (int c)) { unsigned char uc = static_cast<unsigned char>(c); @@ -26,4 +27,4 @@ LLVM_LIBC_FUNCTION(int, putchar, (int c)) { return 0; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/gpu/puts.cpp b/libc/src/stdio/gpu/puts.cpp index f6d91cc..af84432 100644 --- a/libc/src/stdio/gpu/puts.cpp +++ b/libc/src/stdio/gpu/puts.cpp @@ -8,6 +8,7 @@ #include "src/stdio/puts.h" #include "src/__support/CPP/string_view.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" #include "src/stdio/gpu/file.h" @@ -16,7 +17,7 @@ #include <stdio.h> //needed for stdout -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, puts, (const char *__restrict str)) { cpp::string_view str_view(str); @@ -27,4 +28,4 @@ LLVM_LIBC_FUNCTION(int, puts, (const char *__restrict str)) { return 0; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/gpu/remove.cpp b/libc/src/stdio/gpu/remove.cpp index 6b53e1f..3f21e8a 100644 --- a/libc/src/stdio/gpu/remove.cpp +++ b/libc/src/stdio/gpu/remove.cpp @@ -8,10 +8,11 @@ #include "src/stdio/remove.h" #include "file.h" +#include "src/__support/macros/config.h" #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, remove, (const char *path)) { int ret; @@ -23,4 +24,4 @@ LLVM_LIBC_FUNCTION(int, remove, (const char *path)) { return ret; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/gpu/stderr.cpp b/libc/src/stdio/gpu/stderr.cpp index e239b94..efbc3b4 100644 --- a/libc/src/stdio/gpu/stderr.cpp +++ b/libc/src/stdio/gpu/stderr.cpp @@ -7,10 +7,11 @@ //===----------------------------------------------------------------------===// #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { static struct { } stub; FILE *stderr = reinterpret_cast<FILE *>(&stub); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL extern "C" FILE *stderr = reinterpret_cast<FILE *>(&LIBC_NAMESPACE::stub); diff --git a/libc/src/stdio/gpu/stdin.cpp b/libc/src/stdio/gpu/stdin.cpp index 6a305c8..66618fd 100644 --- a/libc/src/stdio/gpu/stdin.cpp +++ b/libc/src/stdio/gpu/stdin.cpp @@ -7,10 +7,11 @@ //===----------------------------------------------------------------------===// #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { static struct { } stub; FILE *stdin = reinterpret_cast<FILE *>(&stub); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL extern "C" FILE *stdin = reinterpret_cast<FILE *>(&LIBC_NAMESPACE::stub); diff --git a/libc/src/stdio/gpu/stdout.cpp b/libc/src/stdio/gpu/stdout.cpp index fffe137..e3869f9 100644 --- a/libc/src/stdio/gpu/stdout.cpp +++ b/libc/src/stdio/gpu/stdout.cpp @@ -7,10 +7,11 @@ //===----------------------------------------------------------------------===// #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { static struct { } stub; FILE *stdout = reinterpret_cast<FILE *>(&stub); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL extern "C" FILE *stdout = reinterpret_cast<FILE *>(&LIBC_NAMESPACE::stub); diff --git a/libc/src/stdio/gpu/ungetc.cpp b/libc/src/stdio/gpu/ungetc.cpp index 52379e1..e9232a5 100644 --- a/libc/src/stdio/gpu/ungetc.cpp +++ b/libc/src/stdio/gpu/ungetc.cpp @@ -8,10 +8,11 @@ #include "src/stdio/ungetc.h" #include "file.h" +#include "src/__support/macros/config.h" #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, ungetc, (int c, ::FILE *stream)) { int ret; @@ -26,4 +27,4 @@ LLVM_LIBC_FUNCTION(int, ungetc, (int c, ::FILE *stream)) { return ret; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/linux/fdopen.cpp b/libc/src/stdio/linux/fdopen.cpp index a1d08ee..7d72fdc 100644 --- a/libc/src/stdio/linux/fdopen.cpp +++ b/libc/src/stdio/linux/fdopen.cpp @@ -9,9 +9,10 @@ #include "src/stdio/fdopen.h" #include "src/__support/File/linux/file.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(::FILE *, fdopen, (int fd, const char *mode)) { auto result = LIBC_NAMESPACE::create_file_from_fd(fd, mode); @@ -22,4 +23,4 @@ LLVM_LIBC_FUNCTION(::FILE *, fdopen, (int fd, const char *mode)) { return reinterpret_cast<::FILE *>(result.value()); } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/linux/remove.cpp b/libc/src/stdio/linux/remove.cpp index b2742c2..9e299aa 100644 --- a/libc/src/stdio/linux/remove.cpp +++ b/libc/src/stdio/linux/remove.cpp @@ -11,11 +11,12 @@ #include "src/__support/OSUtil/syscall.h" // For internal syscall function. #include "src/__support/common.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" #include <fcntl.h> // For AT_* macros. #include <sys/syscall.h> // For syscall numbers. -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, remove, (const char *path)) { // We first try unlinking it as a file. If it is ia file, it will succeed. If @@ -30,4 +31,4 @@ LLVM_LIBC_FUNCTION(int, remove, (const char *path)) { return -1; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/linux/rename.cpp b/libc/src/stdio/linux/rename.cpp index 379a6ef..69fd227 100644 --- a/libc/src/stdio/linux/rename.cpp +++ b/libc/src/stdio/linux/rename.cpp @@ -10,10 +10,11 @@ #include "include/llvm-libc-macros/linux/fcntl-macros.h" #include "src/__support/OSUtil/syscall.h" // For internal syscall function. #include "src/__support/common.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" #include <sys/syscall.h> // For syscall numbers. -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, rename, (const char *oldpath, const char *newpath)) { int ret = LIBC_NAMESPACE::syscall_impl<int>(SYS_renameat2, AT_FDCWD, oldpath, @@ -25,4 +26,4 @@ LLVM_LIBC_FUNCTION(int, rename, (const char *oldpath, const char *newpath)) { return -1; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/printf.h b/libc/src/stdio/printf.h index 60ccf61..9e47ad8 100644 --- a/libc/src/stdio/printf.h +++ b/libc/src/stdio/printf.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_PRINTF_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int printf(const char *__restrict format, ...); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_PRINTF_H diff --git a/libc/src/stdio/printf_core/char_converter.h b/libc/src/stdio/printf_core/char_converter.h index 13596b8..2596cba 100644 --- a/libc/src/stdio/printf_core/char_converter.h +++ b/libc/src/stdio/printf_core/char_converter.h @@ -9,11 +9,12 @@ #ifndef LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CHAR_CONVERTER_H #define LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CHAR_CONVERTER_H +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/converter_utils.h" #include "src/stdio/printf_core/core_structs.h" #include "src/stdio/printf_core/writer.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace printf_core { LIBC_INLINE int convert_char(Writer *writer, const FormatSection &to_conv) { @@ -42,6 +43,6 @@ LIBC_INLINE int convert_char(Writer *writer, const FormatSection &to_conv) { } } // namespace printf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CHAR_CONVERTER_H diff --git a/libc/src/stdio/printf_core/converter.cpp b/libc/src/stdio/printf_core/converter.cpp index 613d693..37af5dc 100644 --- a/libc/src/stdio/printf_core/converter.cpp +++ b/libc/src/stdio/printf_core/converter.cpp @@ -8,6 +8,7 @@ #include "src/stdio/printf_core/converter.h" +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/core_structs.h" #include "src/stdio/printf_core/printf_config.h" #include "src/stdio/printf_core/writer.h" @@ -22,7 +23,7 @@ #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace printf_core { int convert(Writer *writer, const FormatSection &to_conv) { @@ -96,4 +97,4 @@ int convert(Writer *writer, const FormatSection &to_conv) { } } // namespace printf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/printf_core/converter.h b/libc/src/stdio/printf_core/converter.h index d653f1e..2b3f06d 100644 --- a/libc/src/stdio/printf_core/converter.h +++ b/libc/src/stdio/printf_core/converter.h @@ -9,12 +9,13 @@ #ifndef LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CONVERTER_H #define LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CONVERTER_H +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/core_structs.h" #include "src/stdio/printf_core/writer.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace printf_core { // convert will call a conversion function to convert the FormatSection into @@ -23,6 +24,6 @@ namespace printf_core { int convert(Writer *writer, const FormatSection &to_conv); } // namespace printf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CONVERTER_H diff --git a/libc/src/stdio/printf_core/converter_utils.h b/libc/src/stdio/printf_core/converter_utils.h index a0e96a1..3f25ebf 100644 --- a/libc/src/stdio/printf_core/converter_utils.h +++ b/libc/src/stdio/printf_core/converter_utils.h @@ -10,12 +10,13 @@ #define LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CONVERTER_UTILS_H #include "src/__support/CPP/limits.h" +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/core_structs.h" #include <inttypes.h> #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace printf_core { LIBC_INLINE uintmax_t apply_length_modifier(uintmax_t num, @@ -69,6 +70,6 @@ LIBC_INLINE uintmax_t apply_length_modifier(uintmax_t num, enum class RoundDirection { Up, Down, Even }; } // namespace printf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CONVERTER_UTILS_H diff --git a/libc/src/stdio/printf_core/core_structs.h b/libc/src/stdio/printf_core/core_structs.h index bfe362b..76d006b 100644 --- a/libc/src/stdio/printf_core/core_structs.h +++ b/libc/src/stdio/printf_core/core_structs.h @@ -19,7 +19,7 @@ #include <inttypes.h> #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace printf_core { // These length modifiers match the length modifiers in the format string, which @@ -136,6 +136,6 @@ constexpr int INT_CONVERSION_ERROR = -4; constexpr int FIXED_POINT_CONVERSION_ERROR = -5; } // namespace printf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CORE_STRUCTS_H diff --git a/libc/src/stdio/printf_core/fixed_converter.h b/libc/src/stdio/printf_core/fixed_converter.h index de69c60..c8812d7 100644 --- a/libc/src/stdio/printf_core/fixed_converter.h +++ b/libc/src/stdio/printf_core/fixed_converter.h @@ -15,6 +15,7 @@ #include "src/__support/fixed_point/fx_rep.h" #include "src/__support/integer_to_string.h" #include "src/__support/libc_assert.h" +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/converter_utils.h" #include "src/stdio/printf_core/core_structs.h" #include "src/stdio/printf_core/writer.h" @@ -22,7 +23,7 @@ #include <inttypes.h> #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace printf_core { // This is just for assertions. It will be compiled out for release builds. @@ -304,6 +305,6 @@ LIBC_INLINE int convert_fixed(Writer *writer, const FormatSection &to_conv) { } } // namespace printf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_FIXED_CONVERTER_H diff --git a/libc/src/stdio/printf_core/float_dec_converter.h b/libc/src/stdio/printf_core/float_dec_converter.h index 1237db6..e39ba6e 100644 --- a/libc/src/stdio/printf_core/float_dec_converter.h +++ b/libc/src/stdio/printf_core/float_dec_converter.h @@ -16,6 +16,7 @@ #include "src/__support/float_to_string.h" #include "src/__support/integer_to_string.h" #include "src/__support/libc_assert.h" +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/converter_utils.h" #include "src/stdio/printf_core/core_structs.h" #include "src/stdio/printf_core/float_inf_nan_converter.h" @@ -24,7 +25,7 @@ #include <inttypes.h> #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace printf_core { using StorageType = fputil::FPBits<long double>::StorageType; @@ -1170,6 +1171,6 @@ LIBC_INLINE int convert_float_dec_auto(Writer *writer, } } // namespace printf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_FLOAT_DEC_CONVERTER_H diff --git a/libc/src/stdio/printf_core/float_hex_converter.h b/libc/src/stdio/printf_core/float_hex_converter.h index 8fac36d..0b3ff3d 100644 --- a/libc/src/stdio/printf_core/float_hex_converter.h +++ b/libc/src/stdio/printf_core/float_hex_converter.h @@ -12,6 +12,7 @@ #include "src/__support/CPP/string_view.h" #include "src/__support/FPUtil/FPBits.h" #include "src/__support/FPUtil/rounding_mode.h" +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/converter_utils.h" #include "src/stdio/printf_core/core_structs.h" #include "src/stdio/printf_core/float_inf_nan_converter.h" @@ -20,7 +21,7 @@ #include <inttypes.h> #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace printf_core { LIBC_INLINE int convert_float_hex_exp(Writer *writer, @@ -255,6 +256,6 @@ LIBC_INLINE int convert_float_hex_exp(Writer *writer, } } // namespace printf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_FLOAT_HEX_CONVERTER_H diff --git a/libc/src/stdio/printf_core/float_inf_nan_converter.h b/libc/src/stdio/printf_core/float_inf_nan_converter.h index f755ef6..a7da682 100644 --- a/libc/src/stdio/printf_core/float_inf_nan_converter.h +++ b/libc/src/stdio/printf_core/float_inf_nan_converter.h @@ -10,6 +10,7 @@ #define LLVM_LIBC_SRC_STDIO_PRINTF_CORE_FLOAT_INF_NAN_CONVERTER_H #include "src/__support/FPUtil/FPBits.h" +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/converter_utils.h" #include "src/stdio/printf_core/core_structs.h" #include "src/stdio/printf_core/writer.h" @@ -17,7 +18,7 @@ #include <inttypes.h> #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace printf_core { using StorageType = fputil::FPBits<long double>::StorageType; @@ -78,6 +79,6 @@ LIBC_INLINE int convert_inf_nan(Writer *writer, const FormatSection &to_conv) { } } // namespace printf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_FLOAT_INF_NAN_CONVERTER_H diff --git a/libc/src/stdio/printf_core/int_converter.h b/libc/src/stdio/printf_core/int_converter.h index 496e7bd..f345e86 100644 --- a/libc/src/stdio/printf_core/int_converter.h +++ b/libc/src/stdio/printf_core/int_converter.h @@ -12,6 +12,7 @@ #include "src/__support/CPP/span.h" #include "src/__support/CPP/string_view.h" #include "src/__support/integer_to_string.h" +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/converter_utils.h" #include "src/stdio/printf_core/core_structs.h" #include "src/stdio/printf_core/writer.h" @@ -19,7 +20,7 @@ #include <inttypes.h> #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace printf_core { // These functions only work on characters that are already known to be in the @@ -209,6 +210,6 @@ LIBC_INLINE int convert_int(Writer *writer, const FormatSection &to_conv) { } } // namespace printf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_INT_CONVERTER_H diff --git a/libc/src/stdio/printf_core/parser.h b/libc/src/stdio/printf_core/parser.h index b9a8f30..207affd 100644 --- a/libc/src/stdio/printf_core/parser.h +++ b/libc/src/stdio/printf_core/parser.h @@ -13,6 +13,7 @@ #include "src/__support/CPP/algorithm.h" // max #include "src/__support/CPP/optional.h" #include "src/__support/CPP/type_traits.h" +#include "src/__support/macros/config.h" #include "src/__support/str_to_integer.h" #include "src/stdio/printf_core/core_structs.h" #include "src/stdio/printf_core/printf_config.h" @@ -23,7 +24,7 @@ #include "src/__support/fixed_point/fx_rep.h" #endif // LIBC_INTERNAL_PRINTF_HAS_FIXED_POINT -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace printf_core { template <typename T> struct int_type_of { @@ -668,6 +669,6 @@ private: }; } // namespace printf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_PARSER_H diff --git a/libc/src/stdio/printf_core/printf_main.cpp b/libc/src/stdio/printf_core/printf_main.cpp index 54e70f5..bd4a5a16 100644 --- a/libc/src/stdio/printf_core/printf_main.cpp +++ b/libc/src/stdio/printf_core/printf_main.cpp @@ -9,6 +9,7 @@ #include "src/stdio/printf_core/printf_main.h" #include "src/__support/arg_list.h" +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/converter.h" #include "src/stdio/printf_core/core_structs.h" #include "src/stdio/printf_core/parser.h" @@ -16,7 +17,7 @@ #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace printf_core { int printf_main(Writer *writer, const char *__restrict str, @@ -39,4 +40,4 @@ int printf_main(Writer *writer, const char *__restrict str, } } // namespace printf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/printf_core/printf_main.h b/libc/src/stdio/printf_core/printf_main.h index 15c6977..3e73bf36 100644 --- a/libc/src/stdio/printf_core/printf_main.h +++ b/libc/src/stdio/printf_core/printf_main.h @@ -10,17 +10,18 @@ #define LLVM_LIBC_SRC_STDIO_PRINTF_CORE_PRINTF_MAIN_H #include "src/__support/arg_list.h" +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/writer.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace printf_core { int printf_main(Writer *writer, const char *__restrict str, internal::ArgList &args); } // namespace printf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_PRINTF_MAIN_H diff --git a/libc/src/stdio/printf_core/ptr_converter.h b/libc/src/stdio/printf_core/ptr_converter.h index c5d4086..bf84718 100644 --- a/libc/src/stdio/printf_core/ptr_converter.h +++ b/libc/src/stdio/printf_core/ptr_converter.h @@ -9,12 +9,13 @@ #ifndef LLVM_LIBC_SRC_STDIO_PRINTF_CORE_PTR_CONVERTER_H #define LLVM_LIBC_SRC_STDIO_PRINTF_CORE_PTR_CONVERTER_H +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/core_structs.h" #include "src/stdio/printf_core/int_converter.h" #include "src/stdio/printf_core/string_converter.h" #include "src/stdio/printf_core/writer.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace printf_core { LIBC_INLINE int convert_pointer(Writer *writer, const FormatSection &to_conv) { @@ -35,6 +36,6 @@ LIBC_INLINE int convert_pointer(Writer *writer, const FormatSection &to_conv) { } } // namespace printf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_PTR_CONVERTER_H diff --git a/libc/src/stdio/printf_core/string_converter.h b/libc/src/stdio/printf_core/string_converter.h index 9e05591..1f36d51 100644 --- a/libc/src/stdio/printf_core/string_converter.h +++ b/libc/src/stdio/printf_core/string_converter.h @@ -10,13 +10,14 @@ #define LLVM_LIBC_SRC_STDIO_PRINTF_CORE_STRING_CONVERTER_H #include "src/__support/CPP/string_view.h" +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/converter_utils.h" #include "src/stdio/printf_core/core_structs.h" #include "src/stdio/printf_core/writer.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace printf_core { LIBC_INLINE int convert_string(Writer *writer, const FormatSection &to_conv) { @@ -58,6 +59,6 @@ LIBC_INLINE int convert_string(Writer *writer, const FormatSection &to_conv) { } } // namespace printf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_STRING_CONVERTER_H diff --git a/libc/src/stdio/printf_core/vfprintf_internal.h b/libc/src/stdio/printf_core/vfprintf_internal.h index 2917aa2..3becfee 100644 --- a/libc/src/stdio/printf_core/vfprintf_internal.h +++ b/libc/src/stdio/printf_core/vfprintf_internal.h @@ -12,13 +12,14 @@ #include "src/__support/File/file.h" #include "src/__support/arg_list.h" #include "src/__support/macros/attributes.h" // For LIBC_INLINE +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/core_structs.h" #include "src/stdio/printf_core/printf_main.h" #include "src/stdio/printf_core/writer.h" #include "hdr/types/FILE.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace internal { #ifndef LIBC_COPT_STDIO_USE_SYSTEM_FILE @@ -84,6 +85,6 @@ LIBC_INLINE int vfprintf_internal(::FILE *__restrict stream, } } // namespace printf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_VFPRINTF_INTERNAL_H diff --git a/libc/src/stdio/printf_core/write_int_converter.h b/libc/src/stdio/printf_core/write_int_converter.h index 18aa5c79..a47cb41c 100644 --- a/libc/src/stdio/printf_core/write_int_converter.h +++ b/libc/src/stdio/printf_core/write_int_converter.h @@ -9,13 +9,14 @@ #ifndef LLVM_LIBC_SRC_STDIO_PRINTF_CORE_WRITE_INT_CONVERTER_H #define LLVM_LIBC_SRC_STDIO_PRINTF_CORE_WRITE_INT_CONVERTER_H +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/core_structs.h" #include "src/stdio/printf_core/writer.h" #include <inttypes.h> #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace printf_core { LIBC_INLINE int convert_write_int(Writer *writer, @@ -64,6 +65,6 @@ LIBC_INLINE int convert_write_int(Writer *writer, } } // namespace printf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_WRITE_INT_CONVERTER_H diff --git a/libc/src/stdio/printf_core/writer.cpp b/libc/src/stdio/printf_core/writer.cpp index f8ecd82..d1cf85d 100644 --- a/libc/src/stdio/printf_core/writer.cpp +++ b/libc/src/stdio/printf_core/writer.cpp @@ -8,11 +8,12 @@ #include "writer.h" #include "src/__support/CPP/string_view.h" +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/core_structs.h" #include "src/string/memory_utils/inline_memset.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace printf_core { int Writer::pad(char new_char, size_t length) { @@ -42,4 +43,4 @@ int Writer::pad(char new_char, size_t length) { } } // namespace printf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/printf_core/writer.h b/libc/src/stdio/printf_core/writer.h index 67513ec..8942156 100644 --- a/libc/src/stdio/printf_core/writer.h +++ b/libc/src/stdio/printf_core/writer.h @@ -10,6 +10,7 @@ #define LLVM_LIBC_SRC_STDIO_PRINTF_CORE_WRITER_H #include "src/__support/CPP/string_view.h" +#include "src/__support/macros/config.h" #include "src/__support/macros/optimization.h" #include "src/stdio/printf_core/core_structs.h" #include "src/string/memory_utils/inline_memcpy.h" @@ -17,7 +18,7 @@ #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace printf_core { struct WriteBuffer { @@ -134,6 +135,6 @@ public: }; } // namespace printf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_WRITER_H diff --git a/libc/src/stdio/putc.h b/libc/src/stdio/putc.h index 9d331d0..35ec07b 100644 --- a/libc/src/stdio/putc.h +++ b/libc/src/stdio/putc.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_PUTC_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int putc(int c, ::FILE *stream); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_PUTC_H diff --git a/libc/src/stdio/putchar.h b/libc/src/stdio/putchar.h index e458e31..84a5ea8 100644 --- a/libc/src/stdio/putchar.h +++ b/libc/src/stdio/putchar.h @@ -9,10 +9,12 @@ #ifndef LLVM_LIBC_SRC_STDIO_PUTCHAR_H #define LLVM_LIBC_SRC_STDIO_PUTCHAR_H -namespace LIBC_NAMESPACE { +#include "src/__support/macros/config.h" + +namespace LIBC_NAMESPACE_DECL { int putchar(int c); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_PUTCHAR_H diff --git a/libc/src/stdio/puts.h b/libc/src/stdio/puts.h index 68d5225..d93495b 100644 --- a/libc/src/stdio/puts.h +++ b/libc/src/stdio/puts.h @@ -9,10 +9,12 @@ #ifndef LLVM_LIBC_SRC_STDIO_PUTS_H #define LLVM_LIBC_SRC_STDIO_PUTS_H -namespace LIBC_NAMESPACE { +#include "src/__support/macros/config.h" + +namespace LIBC_NAMESPACE_DECL { int puts(const char *__restrict str); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_PUTS_H diff --git a/libc/src/stdio/remove.h b/libc/src/stdio/remove.h index 3e541a0..267946f 100644 --- a/libc/src/stdio/remove.h +++ b/libc/src/stdio/remove.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_REMOVE_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int remove(const char *path); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_REMOVE_H diff --git a/libc/src/stdio/rename.h b/libc/src/stdio/rename.h index eadda7c..5c9ab88 100644 --- a/libc/src/stdio/rename.h +++ b/libc/src/stdio/rename.h @@ -9,10 +9,12 @@ #ifndef LLVM_LIBC_SRC_STDIO_RENAME_H #define LLVM_LIBC_SRC_STDIO_RENAME_H -namespace LIBC_NAMESPACE { +#include "src/__support/macros/config.h" + +namespace LIBC_NAMESPACE_DECL { int rename(const char *oldpath, const char *newpath); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_RENAME_H diff --git a/libc/src/stdio/scanf.cpp b/libc/src/stdio/scanf.cpp index bfa8d46..86a8851 100644 --- a/libc/src/stdio/scanf.cpp +++ b/libc/src/stdio/scanf.cpp @@ -10,6 +10,7 @@ #include "src/__support/File/file.h" #include "src/__support/arg_list.h" +#include "src/__support/macros/config.h" #include "src/stdio/scanf_core/vfscanf_internal.h" #include "hdr/types/FILE.h" @@ -21,7 +22,7 @@ #define SCANF_STDIN ::stdin #endif // LIBC_COPT_STDIO_USE_SYSTEM_FILE -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, scanf, (const char *__restrict format, ...)) { va_list vlist; @@ -37,4 +38,4 @@ LLVM_LIBC_FUNCTION(int, scanf, (const char *__restrict format, ...)) { return (ret_val == -1) ? EOF : ret_val; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/scanf.h b/libc/src/stdio/scanf.h index 58e42d1..f3349c7 100644 --- a/libc/src/stdio/scanf.h +++ b/libc/src/stdio/scanf.h @@ -9,10 +9,12 @@ #ifndef LLVM_LIBC_SRC_STDIO_SCANF_H #define LLVM_LIBC_SRC_STDIO_SCANF_H -namespace LIBC_NAMESPACE { +#include "src/__support/macros/config.h" + +namespace LIBC_NAMESPACE_DECL { int scanf(const char *__restrict format, ...); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_SCANF_H diff --git a/libc/src/stdio/scanf_core/converter.cpp b/libc/src/stdio/scanf_core/converter.cpp index 5334af1..b1ee8cd 100644 --- a/libc/src/stdio/scanf_core/converter.cpp +++ b/libc/src/stdio/scanf_core/converter.cpp @@ -9,6 +9,7 @@ #include "src/stdio/scanf_core/converter.h" #include "src/__support/ctype_utils.h" +#include "src/__support/macros/config.h" #include "src/stdio/scanf_core/core_structs.h" #include "src/stdio/scanf_core/reader.h" @@ -22,7 +23,7 @@ #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace scanf_core { int convert(Reader *reader, const FormatSection &to_conv) { @@ -99,4 +100,4 @@ int raw_match(Reader *reader, cpp::string_view raw_string) { } } // namespace scanf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/scanf_core/converter.h b/libc/src/stdio/scanf_core/converter.h index f741840..3f514ee 100644 --- a/libc/src/stdio/scanf_core/converter.h +++ b/libc/src/stdio/scanf_core/converter.h @@ -10,12 +10,13 @@ #define LLVM_LIBC_SRC_STDIO_SCANF_CORE_CONVERTER_H #include "src/__support/CPP/string_view.h" +#include "src/__support/macros/config.h" #include "src/stdio/scanf_core/core_structs.h" #include "src/stdio/scanf_core/reader.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace scanf_core { // convert will call a conversion function to convert the FormatSection into @@ -28,6 +29,6 @@ int convert(Reader *reader, const FormatSection &to_conv); int raw_match(Reader *reader, cpp::string_view raw_string); } // namespace scanf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_SCANF_CORE_CONVERTER_H diff --git a/libc/src/stdio/scanf_core/converter_utils.h b/libc/src/stdio/scanf_core/converter_utils.h index a25e8a7..6195455 100644 --- a/libc/src/stdio/scanf_core/converter_utils.h +++ b/libc/src/stdio/scanf_core/converter_utils.h @@ -10,12 +10,13 @@ #define LLVM_LIBC_SRC_STDIO_SCANF_CORE_CONVERTER_UTILS_H #include "src/__support/ctype_utils.h" +#include "src/__support/macros/config.h" #include "src/__support/str_to_float.h" #include "src/stdio/scanf_core/core_structs.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace scanf_core { LIBC_INLINE constexpr char to_lower(char a) { return a | 32; } @@ -106,6 +107,6 @@ LIBC_INLINE void write_float_with_length(char *str, } } // namespace scanf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_SCANF_CORE_CONVERTER_UTILS_H diff --git a/libc/src/stdio/scanf_core/core_structs.h b/libc/src/stdio/scanf_core/core_structs.h index 29e1bf2..87b2429 100644 --- a/libc/src/stdio/scanf_core/core_structs.h +++ b/libc/src/stdio/scanf_core/core_structs.h @@ -11,11 +11,12 @@ #include "src/__support/CPP/bitset.h" #include "src/__support/CPP/string_view.h" +#include "src/__support/macros/config.h" #include <inttypes.h> #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace scanf_core { // These length modifiers match the length modifiers in the format string, which @@ -86,6 +87,6 @@ enum ErrorCodes : int { ALLOCATION_FAILURE = -4, }; } // namespace scanf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_SCANF_CORE_CORE_STRUCTS_H diff --git a/libc/src/stdio/scanf_core/current_pos_converter.h b/libc/src/stdio/scanf_core/current_pos_converter.h index be25cef..8af1cc0 100644 --- a/libc/src/stdio/scanf_core/current_pos_converter.h +++ b/libc/src/stdio/scanf_core/current_pos_converter.h @@ -9,13 +9,14 @@ #ifndef LLVM_LIBC_SRC_STDIO_SCANF_CORE_CURRENT_POS_CONVERTER_H #define LLVM_LIBC_SRC_STDIO_SCANF_CORE_CURRENT_POS_CONVERTER_H +#include "src/__support/macros/config.h" #include "src/stdio/scanf_core/converter_utils.h" #include "src/stdio/scanf_core/core_structs.h" #include "src/stdio/scanf_core/reader.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace scanf_core { LIBC_INLINE int convert_current_pos(Reader *reader, @@ -25,6 +26,6 @@ LIBC_INLINE int convert_current_pos(Reader *reader, } } // namespace scanf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_SCANF_CORE_CURRENT_POS_CONVERTER_H diff --git a/libc/src/stdio/scanf_core/float_converter.cpp b/libc/src/stdio/scanf_core/float_converter.cpp index 8500d98..b2d60a2 100644 --- a/libc/src/stdio/scanf_core/float_converter.cpp +++ b/libc/src/stdio/scanf_core/float_converter.cpp @@ -11,13 +11,14 @@ #include "src/__support/CPP/limits.h" #include "src/__support/char_vector.h" #include "src/__support/ctype_utils.h" +#include "src/__support/macros/config.h" #include "src/stdio/scanf_core/converter_utils.h" #include "src/stdio/scanf_core/core_structs.h" #include "src/stdio/scanf_core/reader.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace scanf_core { // All of the floating point conversions are the same for scanf, every name will @@ -223,4 +224,4 @@ int convert_float(Reader *reader, const FormatSection &to_conv) { } } // namespace scanf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/scanf_core/float_converter.h b/libc/src/stdio/scanf_core/float_converter.h index a3ea1da..bd44847 100644 --- a/libc/src/stdio/scanf_core/float_converter.h +++ b/libc/src/stdio/scanf_core/float_converter.h @@ -9,17 +9,18 @@ #ifndef LLVM_LIBC_SRC_STDIO_SCANF_CORE_FLOAT_CONVERTER_H #define LLVM_LIBC_SRC_STDIO_SCANF_CORE_FLOAT_CONVERTER_H +#include "src/__support/macros/config.h" #include "src/stdio/scanf_core/core_structs.h" #include "src/stdio/scanf_core/reader.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace scanf_core { int convert_float(Reader *reader, const FormatSection &to_conv); } // namespace scanf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_SCANF_CORE_FLOAT_CONVERTER_H diff --git a/libc/src/stdio/scanf_core/int_converter.cpp b/libc/src/stdio/scanf_core/int_converter.cpp index 05d6ed6..136db2a 100644 --- a/libc/src/stdio/scanf_core/int_converter.cpp +++ b/libc/src/stdio/scanf_core/int_converter.cpp @@ -10,13 +10,14 @@ #include "src/__support/CPP/limits.h" #include "src/__support/ctype_utils.h" +#include "src/__support/macros/config.h" #include "src/stdio/scanf_core/converter_utils.h" #include "src/stdio/scanf_core/core_structs.h" #include "src/stdio/scanf_core/reader.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace scanf_core { // This code is very similar to the code in __support/str_to_integer.h but is @@ -212,4 +213,4 @@ int convert_int(Reader *reader, const FormatSection &to_conv) { } } // namespace scanf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/scanf_core/int_converter.h b/libc/src/stdio/scanf_core/int_converter.h index 7c9d8b4..5fc27ad 100644 --- a/libc/src/stdio/scanf_core/int_converter.h +++ b/libc/src/stdio/scanf_core/int_converter.h @@ -9,17 +9,18 @@ #ifndef LLVM_LIBC_SRC_STDIO_SCANF_CORE_INT_CONVERTER_H #define LLVM_LIBC_SRC_STDIO_SCANF_CORE_INT_CONVERTER_H +#include "src/__support/macros/config.h" #include "src/stdio/scanf_core/core_structs.h" #include "src/stdio/scanf_core/reader.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace scanf_core { int convert_int(Reader *reader, const FormatSection &to_conv); } // namespace scanf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_SCANF_CORE_INT_CONVERTER_H diff --git a/libc/src/stdio/scanf_core/parser.h b/libc/src/stdio/scanf_core/parser.h index 5ae9009..6cc5b30 100644 --- a/libc/src/stdio/scanf_core/parser.h +++ b/libc/src/stdio/scanf_core/parser.h @@ -11,13 +11,14 @@ #include "src/__support/arg_list.h" #include "src/__support/ctype_utils.h" +#include "src/__support/macros/config.h" #include "src/__support/str_to_integer.h" #include "src/stdio/scanf_core/core_structs.h" #include "src/stdio/scanf_core/scanf_config.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace scanf_core { #ifndef LIBC_COPT_SCANF_DISABLE_INDEX_MODE @@ -279,6 +280,6 @@ private: }; } // namespace scanf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_SCANF_CORE_PARSER_H diff --git a/libc/src/stdio/scanf_core/ptr_converter.cpp b/libc/src/stdio/scanf_core/ptr_converter.cpp index cc233c36..1a42a38 100644 --- a/libc/src/stdio/scanf_core/ptr_converter.cpp +++ b/libc/src/stdio/scanf_core/ptr_converter.cpp @@ -8,6 +8,7 @@ #include "src/stdio/scanf_core/ptr_converter.h" +#include "src/__support/macros/config.h" #include "src/stdio/scanf_core/converter_utils.h" #include "src/stdio/scanf_core/core_structs.h" #include "src/stdio/scanf_core/int_converter.h" @@ -15,7 +16,7 @@ #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace scanf_core { int convert_pointer(Reader *reader, const FormatSection &to_conv) { static const char nullptr_string[] = "(nullptr)"; @@ -40,4 +41,4 @@ int convert_pointer(Reader *reader, const FormatSection &to_conv) { return convert_int(reader, to_conv); } } // namespace scanf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/scanf_core/ptr_converter.h b/libc/src/stdio/scanf_core/ptr_converter.h index 363d9aa..0732c1c 100644 --- a/libc/src/stdio/scanf_core/ptr_converter.h +++ b/libc/src/stdio/scanf_core/ptr_converter.h @@ -9,17 +9,18 @@ #ifndef LLVM_LIBC_SRC_STDIO_SCANF_CORE_PTR_CONVERTER_H #define LLVM_LIBC_SRC_STDIO_SCANF_CORE_PTR_CONVERTER_H +#include "src/__support/macros/config.h" #include "src/stdio/scanf_core/core_structs.h" #include "src/stdio/scanf_core/reader.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace scanf_core { int convert_pointer(Reader *reader, const FormatSection &to_conv); } // namespace scanf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_SCANF_CORE_PTR_CONVERTER_H diff --git a/libc/src/stdio/scanf_core/reader.cpp b/libc/src/stdio/scanf_core/reader.cpp index eca0e37..ec1f5c0 100644 --- a/libc/src/stdio/scanf_core/reader.cpp +++ b/libc/src/stdio/scanf_core/reader.cpp @@ -7,9 +7,10 @@ //===----------------------------------------------------------------------===// #include "src/stdio/scanf_core/reader.h" +#include "src/__support/macros/config.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace scanf_core { void Reader::ungetc(char c) { @@ -25,4 +26,4 @@ void Reader::ungetc(char c) { stream_ungetc(static_cast<int>(c), input_stream); } } // namespace scanf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/scanf_core/reader.h b/libc/src/stdio/scanf_core/reader.h index f750c43..e7955d6 100644 --- a/libc/src/stdio/scanf_core/reader.h +++ b/libc/src/stdio/scanf_core/reader.h @@ -10,9 +10,10 @@ #define LLVM_LIBC_SRC_STDIO_SCANF_CORE_READER_H #include "src/__support/macros/attributes.h" // For LIBC_INLINE +#include "src/__support/macros/config.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace scanf_core { using StreamGetc = int (*)(void *); @@ -68,6 +69,6 @@ public: }; } // namespace scanf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_SCANF_CORE_READER_H diff --git a/libc/src/stdio/scanf_core/scanf_main.cpp b/libc/src/stdio/scanf_core/scanf_main.cpp index dc7740d..eb48094 100644 --- a/libc/src/stdio/scanf_core/scanf_main.cpp +++ b/libc/src/stdio/scanf_core/scanf_main.cpp @@ -9,6 +9,7 @@ #include "src/stdio/scanf_core/scanf_main.h" #include "src/__support/arg_list.h" +#include "src/__support/macros/config.h" #include "src/stdio/scanf_core/converter.h" #include "src/stdio/scanf_core/core_structs.h" #include "src/stdio/scanf_core/parser.h" @@ -16,7 +17,7 @@ #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace scanf_core { int scanf_main(Reader *reader, const char *__restrict str, @@ -42,4 +43,4 @@ int scanf_main(Reader *reader, const char *__restrict str, } } // namespace scanf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/scanf_core/scanf_main.h b/libc/src/stdio/scanf_core/scanf_main.h index f1688d6..27c2469 100644 --- a/libc/src/stdio/scanf_core/scanf_main.h +++ b/libc/src/stdio/scanf_core/scanf_main.h @@ -10,17 +10,18 @@ #define LLVM_LIBC_SRC_STDIO_SCANF_CORE_SCANF_MAIN_H #include "src/__support/arg_list.h" +#include "src/__support/macros/config.h" #include "src/stdio/scanf_core/reader.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace scanf_core { int scanf_main(Reader *reader, const char *__restrict str, internal::ArgList &args); } // namespace scanf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_SCANF_CORE_SCANF_MAIN_H diff --git a/libc/src/stdio/scanf_core/string_converter.cpp b/libc/src/stdio/scanf_core/string_converter.cpp index 94a7fc4..0de2eee 100644 --- a/libc/src/stdio/scanf_core/string_converter.cpp +++ b/libc/src/stdio/scanf_core/string_converter.cpp @@ -10,12 +10,13 @@ #include "src/__support/CPP/limits.h" #include "src/__support/ctype_utils.h" +#include "src/__support/macros/config.h" #include "src/stdio/scanf_core/core_structs.h" #include "src/stdio/scanf_core/reader.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace scanf_core { int convert_string(Reader *reader, const FormatSection &to_conv) { @@ -73,4 +74,4 @@ int convert_string(Reader *reader, const FormatSection &to_conv) { } } // namespace scanf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/scanf_core/string_converter.h b/libc/src/stdio/scanf_core/string_converter.h index 165fc47..552dc22 100644 --- a/libc/src/stdio/scanf_core/string_converter.h +++ b/libc/src/stdio/scanf_core/string_converter.h @@ -9,17 +9,18 @@ #ifndef LLVM_LIBC_SRC_STDIO_SCANF_CORE_STRING_CONVERTER_H #define LLVM_LIBC_SRC_STDIO_SCANF_CORE_STRING_CONVERTER_H +#include "src/__support/macros/config.h" #include "src/stdio/scanf_core/core_structs.h" #include "src/stdio/scanf_core/reader.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace scanf_core { int convert_string(Reader *reader, const FormatSection &to_conv); } // namespace scanf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_SCANF_CORE_STRING_CONVERTER_H diff --git a/libc/src/stdio/scanf_core/vfscanf_internal.h b/libc/src/stdio/scanf_core/vfscanf_internal.h index 0571eac..2b0072a 100644 --- a/libc/src/stdio/scanf_core/vfscanf_internal.h +++ b/libc/src/stdio/scanf_core/vfscanf_internal.h @@ -11,13 +11,14 @@ #include "src/__support/File/file.h" #include "src/__support/arg_list.h" +#include "src/__support/macros/config.h" #include "src/stdio/scanf_core/reader.h" #include "src/stdio/scanf_core/scanf_main.h" #include "hdr/types/FILE.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { namespace internal { @@ -85,6 +86,6 @@ LIBC_INLINE int vfscanf_internal(::FILE *__restrict stream, return retval; } } // namespace scanf_core -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_SCANF_CORE_VFSCANF_INTERNAL_H diff --git a/libc/src/stdio/setbuf.cpp b/libc/src/stdio/setbuf.cpp index 61a5cc6..f3db97d 100644 --- a/libc/src/stdio/setbuf.cpp +++ b/libc/src/stdio/setbuf.cpp @@ -9,9 +9,10 @@ #include "src/stdio/setbuf.h" #include "hdr/stdio_macros.h" #include "src/__support/File/file.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(void, setbuf, (::FILE *__restrict stream, char *__restrict buf)) { @@ -24,4 +25,4 @@ LLVM_LIBC_FUNCTION(void, setbuf, libc_errno = err; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/setbuf.h b/libc/src/stdio/setbuf.h index ec81994..f9d8e89 100644 --- a/libc/src/stdio/setbuf.h +++ b/libc/src/stdio/setbuf.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_SETBUF_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { void setbuf(::FILE *__restrict stream, char *__restrict buf); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_SETBUF_H diff --git a/libc/src/stdio/setvbuf.cpp b/libc/src/stdio/setvbuf.cpp index 186848a..0a6b8ca 100644 --- a/libc/src/stdio/setvbuf.cpp +++ b/libc/src/stdio/setvbuf.cpp @@ -10,10 +10,11 @@ #include "src/__support/File/file.h" #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include "src/errno/libc_errno.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, setvbuf, (::FILE *__restrict stream, char *__restrict buf, int type, @@ -25,4 +26,4 @@ LLVM_LIBC_FUNCTION(int, setvbuf, return err; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/setvbuf.h b/libc/src/stdio/setvbuf.h index 4fe4811..50bfc5c 100644 --- a/libc/src/stdio/setvbuf.h +++ b/libc/src/stdio/setvbuf.h @@ -10,13 +10,14 @@ #define LLVM_LIBC_SRC_STDIO_SETVBUF_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int setvbuf(::FILE *__restrict stream, char *__restrict buf, int type, size_t size); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_SETVBUF_H diff --git a/libc/src/stdio/snprintf.cpp b/libc/src/stdio/snprintf.cpp index fbfc2b2..12ad3cd 100644 --- a/libc/src/stdio/snprintf.cpp +++ b/libc/src/stdio/snprintf.cpp @@ -9,13 +9,14 @@ #include "src/stdio/snprintf.h" #include "src/__support/arg_list.h" +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/printf_main.h" #include "src/stdio/printf_core/writer.h" #include <stdarg.h> #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, snprintf, (char *__restrict buffer, size_t buffsz, @@ -35,4 +36,4 @@ LLVM_LIBC_FUNCTION(int, snprintf, return ret_val; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/snprintf.h b/libc/src/stdio/snprintf.h index 0e4e398..92a6529 100644 --- a/libc/src/stdio/snprintf.h +++ b/libc/src/stdio/snprintf.h @@ -9,13 +9,14 @@ #ifndef LLVM_LIBC_SRC_STDIO_SNPRINTF_H #define LLVM_LIBC_SRC_STDIO_SNPRINTF_H +#include "src/__support/macros/config.h" #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int snprintf(char *__restrict buffer, size_t buffsz, const char *__restrict format, ...); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_SNPRINTF_H diff --git a/libc/src/stdio/sprintf.cpp b/libc/src/stdio/sprintf.cpp index 11f2f1a..1f59e6b 100644 --- a/libc/src/stdio/sprintf.cpp +++ b/libc/src/stdio/sprintf.cpp @@ -10,12 +10,13 @@ #include "src/__support/CPP/limits.h" #include "src/__support/arg_list.h" +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/printf_main.h" #include "src/stdio/printf_core/writer.h" #include <stdarg.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, sprintf, (char *__restrict buffer, const char *__restrict format, @@ -35,4 +36,4 @@ LLVM_LIBC_FUNCTION(int, sprintf, return ret_val; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/sprintf.h b/libc/src/stdio/sprintf.h index 14bb4fa..ef65de3 100644 --- a/libc/src/stdio/sprintf.h +++ b/libc/src/stdio/sprintf.h @@ -9,10 +9,12 @@ #ifndef LLVM_LIBC_SRC_STDIO_SPRINTF_H #define LLVM_LIBC_SRC_STDIO_SPRINTF_H -namespace LIBC_NAMESPACE { +#include "src/__support/macros/config.h" + +namespace LIBC_NAMESPACE_DECL { int sprintf(char *__restrict buffer, const char *__restrict format, ...); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_SPRINTF_H diff --git a/libc/src/stdio/sscanf.cpp b/libc/src/stdio/sscanf.cpp index 28c3e75..96d9a2ae 100644 --- a/libc/src/stdio/sscanf.cpp +++ b/libc/src/stdio/sscanf.cpp @@ -10,6 +10,7 @@ #include "src/__support/CPP/limits.h" #include "src/__support/arg_list.h" +#include "src/__support/macros/config.h" #include "src/stdio/scanf_core/reader.h" #include "src/stdio/scanf_core/scanf_main.h" @@ -17,7 +18,7 @@ #include "hdr/types/FILE.h" #include <stdarg.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, sscanf, (const char *__restrict buffer, @@ -37,4 +38,4 @@ LLVM_LIBC_FUNCTION(int, sscanf, return (ret_val == -1) ? EOF : ret_val; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/sscanf.h b/libc/src/stdio/sscanf.h index 9e4b28e..690b260 100644 --- a/libc/src/stdio/sscanf.h +++ b/libc/src/stdio/sscanf.h @@ -9,10 +9,12 @@ #ifndef LLVM_LIBC_SRC_STDIO_SSCANF_H #define LLVM_LIBC_SRC_STDIO_SSCANF_H -namespace LIBC_NAMESPACE { +#include "src/__support/macros/config.h" + +namespace LIBC_NAMESPACE_DECL { int sscanf(const char *__restrict buffer, const char *__restrict format, ...); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_SSCANF_H diff --git a/libc/src/stdio/ungetc.h b/libc/src/stdio/ungetc.h index 9a44704..9e29b2e 100644 --- a/libc/src/stdio/ungetc.h +++ b/libc/src/stdio/ungetc.h @@ -10,11 +10,12 @@ #define LLVM_LIBC_SRC_STDIO_UNGETC_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int ungetc(int c, ::FILE *stream); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_UNGETC_H diff --git a/libc/src/stdio/vfprintf.cpp b/libc/src/stdio/vfprintf.cpp index 4e3d460..01f4265 100644 --- a/libc/src/stdio/vfprintf.cpp +++ b/libc/src/stdio/vfprintf.cpp @@ -10,12 +10,13 @@ #include "src/__support/File/file.h" #include "src/__support/arg_list.h" +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/vfprintf_internal.h" #include "hdr/types/FILE.h" #include <stdarg.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, vfprintf, (::FILE *__restrict stream, const char *__restrict format, @@ -27,4 +28,4 @@ LLVM_LIBC_FUNCTION(int, vfprintf, return ret_val; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/vfprintf.h b/libc/src/stdio/vfprintf.h index af8e3c9..91418c6 100644 --- a/libc/src/stdio/vfprintf.h +++ b/libc/src/stdio/vfprintf.h @@ -10,13 +10,14 @@ #define LLVM_LIBC_SRC_STDIO_VFPRINTF_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include <stdarg.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int vfprintf(::FILE *__restrict stream, const char *__restrict format, va_list vlist); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_VFPRINTF_H diff --git a/libc/src/stdio/vprintf.h b/libc/src/stdio/vprintf.h index adc507a..63f0f3ae 100644 --- a/libc/src/stdio/vprintf.h +++ b/libc/src/stdio/vprintf.h @@ -10,12 +10,13 @@ #define LLVM_LIBC_SRC_STDIO_VPRINTF_H #include "hdr/types/FILE.h" +#include "src/__support/macros/config.h" #include <stdarg.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int vprintf(const char *__restrict format, va_list vlist); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_VPRINTF_H diff --git a/libc/src/stdio/vsnprintf.cpp b/libc/src/stdio/vsnprintf.cpp index 9446d3b..a584c76 100644 --- a/libc/src/stdio/vsnprintf.cpp +++ b/libc/src/stdio/vsnprintf.cpp @@ -9,13 +9,14 @@ #include "src/stdio/vsnprintf.h" #include "src/__support/arg_list.h" +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/printf_main.h" #include "src/stdio/printf_core/writer.h" #include <stdarg.h> #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, vsnprintf, (char *__restrict buffer, size_t buffsz, @@ -32,4 +33,4 @@ LLVM_LIBC_FUNCTION(int, vsnprintf, return ret_val; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/vsnprintf.h b/libc/src/stdio/vsnprintf.h index 6da25fc..27ae763 100644 --- a/libc/src/stdio/vsnprintf.h +++ b/libc/src/stdio/vsnprintf.h @@ -9,14 +9,15 @@ #ifndef LLVM_LIBC_SRC_STDIO_VSNPRINTF_H #define LLVM_LIBC_SRC_STDIO_VSNPRINTF_H +#include "src/__support/macros/config.h" #include <stdarg.h> #include <stddef.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int vsnprintf(char *__restrict buffer, size_t buffsz, const char *__restrict format, va_list vlist); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_VSNPRINTF_H diff --git a/libc/src/stdio/vsprintf.cpp b/libc/src/stdio/vsprintf.cpp index 5ebdf9a..b3978a0 100644 --- a/libc/src/stdio/vsprintf.cpp +++ b/libc/src/stdio/vsprintf.cpp @@ -10,12 +10,13 @@ #include "src/__support/CPP/limits.h" #include "src/__support/arg_list.h" +#include "src/__support/macros/config.h" #include "src/stdio/printf_core/printf_main.h" #include "src/stdio/printf_core/writer.h" #include <stdarg.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(int, vsprintf, (char *__restrict buffer, const char *__restrict format, @@ -32,4 +33,4 @@ LLVM_LIBC_FUNCTION(int, vsprintf, return ret_val; } -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdio/vsprintf.h b/libc/src/stdio/vsprintf.h index fe8def5..abb89ba 100644 --- a/libc/src/stdio/vsprintf.h +++ b/libc/src/stdio/vsprintf.h @@ -9,13 +9,14 @@ #ifndef LLVM_LIBC_SRC_STDIO_VSPRINTF_H #define LLVM_LIBC_SRC_STDIO_VSPRINTF_H +#include "src/__support/macros/config.h" #include <stdarg.h> -namespace LIBC_NAMESPACE { +namespace LIBC_NAMESPACE_DECL { int vsprintf(char *__restrict buffer, const char *__restrict format, va_list vlist); -} // namespace LIBC_NAMESPACE +} // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_STDIO_VSPRINTF_H |