This sets up ECL to be used for compile time C code spilicing.
To compile:
- Download tarball from from https://ecl.common-lisp.dev/
- Extract
| /* | |
| * Creator: Naman Dixit | |
| * Notice: © Copyright 2025 Naman Dixit | |
| */ | |
| #pragma once | |
| #include "std.h" | |
| #define M3D_USE_MATH_H |
| /* | |
| * Creator: Naman Dixit | |
| * Notice: © Copyright 2025 Naman Dixit | |
| */ | |
| #pragma once | |
| #include "std.h" | |
| pragma_clang("clang diagnostic push"); |
This sets up ECL to be used for compile time C code spilicing.
To compile:
| /* | |
| * Creator: Naman Dixit | |
| * Notice: © Copyright 2024 Naman Dixit | |
| * License: BSD Zero Clause License | |
| * SPDX: 0BSD (https://spdx.org/licenses/0BSD.html) | |
| * Language: -*- objective-c -*- | |
| */ | |
| /* | |
| * This is a minimal Objective-C runtime designed for easy embeddability and DLL-based hot-reloading. |
| /* | |
| * Creator: Naman Dixit | |
| * Notice: © Copyright 2024 Naman Dixit | |
| * License: BSD Zero Clause License | |
| * SPDX: 0BSD (https://spdx.org/licenses/0BSD.html) | |
| */ | |
| /* | |
| * This is an single-header zero-dependency easily-embeddable C23 parser and associated pretty-printer. | |
| * |
| /* | |
| * Creator: Naman Dixit | |
| * Notice: © Copyright 2024 Naman Dixit | |
| * License: BSD Zero Clause License | |
| * SPDX: 0BSD (https://spdx.org/licenses/0BSD.html) | |
| */ | |
| /* Example Commands to compile a build.c that includes this file: | |
| * * clang --std=c23 -Iassets\code\ -Iprovisions\sources -ferror-limit=500 build.c -o build.exe -Lprovisions\binaries\win64 -lSDL3 | |
| * * cl /TC /std:clatest /Iassets\code\ /Iprovisions\sources build.c /Febuild.exe /LIBPATH:provisions\binaries\win64 SDL3.lib |
Since SDL is not going to add the feature of converting relative paths to absolute paths, here I will document the commands for each platform to do so manually using the SDL_Process API.
If the relative path is stored in variable called relative_path, the run:
txtfmtAppendF(&tf, "cmd /C for %%i in (\"%s\") do @echo %%~fi", relative_path)| /* | |
| * Creator: Naman Dixit | |
| * Notice: © Copyright 2024 Naman Dixit | |
| * License: BSD Zero Clause License | |
| * SPDX: 0BSD (https://spdx.org/licenses/0BSD.html) | |
| */ | |
| #if !defined(STD_H_INCLUDE_GUARD) | |
| /* Compiler **************************************************************************/ |
| // NOTE Compile without fast math flags. | |
| /* | |
| This is free and unencumbered software released into the public domain. | |
| Anyone is free to copy, modify, publish, use, compile, sell, or | |
| distribute this software, either in source code form or as a compiled | |
| binary, for any purpose, commercial or non-commercial, and by any | |
| means. |
| /* | |
| * Creator: Naman Dixit | |
| * Notice: © Copyright 2023 Naman Dixit | |
| */ | |
| pragma_clang("clang diagnostic push") | |
| pragma_clang("clang diagnostic ignored \"-Wnonportable-system-include-path\"") | |
| pragma_clang("clang diagnostic ignored \"-Wmicrosoft-enum-value\"") | |
| pragma_clang("clang diagnostic ignored \"-Wreserved-identifier\"") | |
| pragma_clang("clang diagnostic ignored \"-Wnon-virtual-dtor\"") |