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
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\"") |
/* | |
* The values in this enumeration are based on the HID Usage Tables for Universal Serial Bus (USB): | |
* https://usb.org/sites/default/files/hut1_4.pdf (Keyboard/Keypad page 0x07) | |
*/ | |
/* Enum Usage ID String */ | |
KEYBOARD_HID_USAGE_ENTRY( RESERVED, 0, "Reserved(0)" ) | |
KEYBOARD_HID_USAGE_ENTRY( ERROR_ROLL_OVER, 1, "ErrorRollOver" ) | |
KEYBOARD_HID_USAGE_ENTRY( POST_FAIL, 2, "PostFail" ) |
/* | |
* Creator: Naman Dixit | |
* Notice: © Copyright 2024 Naman Dixit | |
* License: MIT No Attribution | |
* SPDX: MIT-0 (https://spdx.org/licenses/MIT-0.html) | |
*/ | |
#pragma once | |
template<typename T> |