0.8.5 Change list
Changes / improvements
- Fetching MSVC also optionally fetches C/C++ headers for cross-compilation
- Experimental C backend.
- Allow the
@sectionattribute on local static variables. - Make
$feataccept the same syntax as@feat. - Added
@asmname, which is similar to@cnamebut does not add any normal name-prefixing on targets where that is normal (such as MachO). - Add
--function-sectionsand--data-sections(function-sections/data-sectionsin project.json) to place each function or global variable in its own section, so the linker can discard unused ones #3051. - Removed experimental support for
cenum,faultsetanddistinctalternative names. - Docs now use the
constset,attrmacroandexcuse. - The static Linux binary now uses mimalloc for faster codegen and is aliased to
c3-linux.tar.gz.
Fixes
- Regression for
vec.pow(x). - Macros with "const" declarations were compile time folded despite needing the declaration.
- Vectors created through casts in globals would miscompile, e.g.
Foo global = { .v = (int[<3>])8 }. - Support $$bswap for all power of two integers, including single bytes (in which case it is a no-op).
- Fix source locations for byte literal values continued on a new line.
- Faulty selection of subscript operator overload when calling method #3499
- Retain
@nostripon optimized code even if no use is found, static variables may now also have nostrip. #3500 !=overloads on structs behaved as==#3547.- Multi-dimensional array comparisons on types with
==overloaded would not compare. - Lazy resolution of function pointer types could cause a segfault when unifying ternary types. #3552
@swapnow works with non-pure arguments.- Incorrect lowering of vectors when created from designated initializers with zeroes at the end.
Stdlib changes
- Added
std::gfxmodule. - Added
IntRect,IntVec2,IntVec3andIntVec4types. - Updated organization of the MacOS / Darwin bindings, reorganized by framework, added many functions and split into std::os::darwin and std::os::macos, with among other things easy ObjC dispatch.
- Updated win32 bindings with many functions, reorganized by header.
- Cross-platform dylib handling with
DylibHandle,os::dlopen,os::dlsymand related functions instd::os. - Added
Duration.to_sec - Updated posix libc with
shm_open,shm_unlink,truncateandftruncate. - Add
NonNullandNullabletypes for members with mandatory null checks. - Cap durations and time to long::max/long::min with saturating maths.
- Added
time::FOREVER_PAST,Time::diff_years,Time::diff_months,time::day,time::week,time::month,time::year. - Added
double.is_inf,float.is_inf.