Age | Commit message (Collapse) | Author |
|
- As much as possible avoid dragging system headers into translation
units. This should avoid namespace pollution and, hopefully, speed up
builds a little bit.
- Avoid leaning on the UCRT so much on Windows - prefer native win32
calls and native file handles except where doing so is inconvenient
(in particular, for stat(), which we might try and replace later).
- Also, switch from SystemFunction036 to ProcessPrng on Windows. This
requires us to generate a stub for bcryptprimitives.dll because
Microsoft haven't bothered to provide a link library, but the function
is better-documented and seems to be a more direct under-the-hood call
as well. Apparently it's what's used by the major web browsers these
days, which seems like a good indication it's stable and trusted.
- Lastly, remove a bunch of functions and macros and stuff that weren't
actually being used. It seems good to try and keep the scope of
OS-dependent stuff relatively contained and only add to it when
actually required.
|
|
That sorting function was a bit wonky, so make it just a little bit
wonky instead. chibicc would produce confusing lex errors if given a
stray single quote somewhere, so make it give non-confusing errors.
Also get rid of canonicalize_newline() because it's unnecessary for SST
so long as Windows Git isn't left in its default misconfigured state.
|
|
Another big one. Here's a list of things:
- Since the upcoming C23 standardises typeof(), use it as an extension
for the time being in order to allow passing arbitrary types as
macro/codegen parameters. It wouldn't have been a big leap to do this
even without standardisation since it's apparently an easy extension
to implement - and also, to be honest, this project is essentially glued
to Clang anyway so who cares.
- Likewise, bool, true and false are becoming pre-defined, so
pre-pre-define them now in order to get the benefit of not having to
remember one header everywhere.
- Really ungodly/amazing vcall macro stuff now allows us to call C++
virtual functions like regular C functions. It's pretty cool!
- Events can now take arbitrary parameters and come in two types:
regular events and predicates.
All this makes the base code even uglier but makes the feature
implementation nicer. In other words, it places more of the cognitive
burden on myself and less on other people who might want to contribute.
This is a good tradeoff, because I'm a genius.
|
|
With code from Bill. Thanks Bill!
|