3 ms·
In order to compile the ratpak library from Microsoft's calculator using Clang, I ported part of it from C++ to C. It's written in C++17 with some C features t
by SloopJon 6y ago
In order to compile the ratpak library from Microsoft's calculator using Clang, I ported part of it from C++ to C. It's written in C++17 with some C features that only Visual C++ accepts. Off the top of my head, some of the changes I needed:
* add extern "C" to some of the headers
* include stdbool.h for bool
* include stdint.h for uint64_t et al.
* include stdlib.h and change nullptr to NULL
* change constexpr to enum
* change static_cast to C-style casts
* rewrite a function to take a pointer, rather than a reference
* write a min() function
I probably could have rewritten it as standard C++, but that somehow seemed like a more daunting prospect at the time.