(cogwheel)
Our type-safe unit conversions are nice, but the code to implement them is pretty verbose. llvm-mos has support for C++23, but it doesn't include much of the standard library. Here's the story of what's in the libcxx
directory:
- Include in our source code, to find that it isn't available
- Go to llvm's libc++ source code and download the compare header: https://github.com/llvm/llvm-project/tree/main/libcxx
- Try compiling. See that it needs , download that, try again
- Find it needs a bunch of internal stuff, including entire directories (or at least it's easier to copy entire directories than individual files)
- Check out llvm-project, start copying whole directories and files 'till it stops complaining about missing files
One of the files that didn't exist was __config_site
, but this is produced by a template __config_site.in
a. Rename __config_site.in to __config_site, and comment out all the cmakedefine directives b. try to compile, find what things are broken because of the missing directives c. rewrite cmakedefines to #defines as needed d. rinse and repeat until the problems no longer lead back to __config_site
Another of the files is math.h
which has an include_next
that needs to be disabled or it will try using the one in llvm-mos on top of the one I downloaded. It also has a couple templates and a using (fpclassify) that need to be disabled because they use floating-point related constants that are not defined.