Add vlibc scaffold, build system, and documentation
Establish the repository layout per Vox guidelines (layouts/C.md, building/C.md): Autotools build (GCC-only, C23), five compatibility profiles (--enable-onlyposix/--enable-muslmimic/--enable-muslext/ --enable-spoof, default vlibc), alongside/overwrite install methods, vlibc-gcc/vlibc-clang drivers, static-linking requirement (except spoof), benchmark harness, and tooling (.clang-format/.clang-tidy/ .clangd + compile_commands.json).
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
#ifndef VLIBC_H
|
||||
#define VLIBC_H
|
||||
|
||||
/*
|
||||
* vlibc — public API.
|
||||
*
|
||||
* vlibc is Vox's modern replacement for glibc. This header is the public entry
|
||||
* point for vlibc's own extensions; the C and POSIX standard headers
|
||||
* (<stdio.h>, <string.h>, ...) are provided separately and are gated by the
|
||||
* active compatibility profile.
|
||||
*
|
||||
* Compatibility profiles (build-time; see configure.ac and docs/compatibility.md):
|
||||
* 1 onlyposix pure POSIX, nothing more
|
||||
* 2 muslmimic musl-like, light
|
||||
* 3 muslext musl-extended
|
||||
* 4 spoof glibc replica (drop-in compatibility)
|
||||
* 5 vlibc glibc-extended, the default
|
||||
*/
|
||||
|
||||
#define VLIBC_VERSION_MAJOR 0
|
||||
#define VLIBC_VERSION_MINOR 1
|
||||
#define VLIBC_VERSION_PATCH 0
|
||||
|
||||
#define VLIBC_VERSION_STRING "0.1.0"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Return the vlibc version string ("MAJOR.MINOR.PATCH").
|
||||
*
|
||||
* Declared with __attribute__((const)): the result is a compile-time constant
|
||||
* and the call has no observable side effects. Declaring this intent lets the
|
||||
* compiler fold and eliminate the call, which keeps fully statically linked
|
||||
* binaries small (see docs/overview.md, "Compiler intent").
|
||||
*/
|
||||
__attribute__((const)) const char *
|
||||
vlibc_version(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* VLIBC_H */
|
||||
Reference in New Issue
Block a user