Commit Graph

3957 Commits

Author SHA1 Message Date
Boris Barbulovski
402c00e230 Add Android Aarch64 and x64 support status 2026-02-09 10:26:40 +01:00
Christoffer Lerno
0542c05b88 Update tests. 2026-02-09 10:23:03 +01:00
Christoffer Lerno
67e224c62f Fix windows main 2026-02-09 10:15:49 +01:00
Christoffer Lerno
565b08846f Remove use of tempnam. 2026-02-09 00:04:05 +01:00
Christoffer Lerno
80ad0e02ad Fix tests and error in returning error on function name. 2026-02-08 22:54:24 +01:00
Lucas Alves
b8ee5a4150 fix: add non-API Android NDK lib search path (#2884)
* fix: add sysroot/usr/lib/<triple> to Android linker search paths

* Fix library search order: move libc++_shared logic after API libc paths

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
2026-02-08 15:02:37 +01:00
Christoffer Lerno
445dd155b7 Another #2814 2026-02-08 15:01:27 +01:00
Rauny
abb3efca00 fix: prevent Homebrew dylib contamination in macOS builds (#2908)
When C3_FETCH_LLVM=ON, the fetched LLVM artifact is self-contained.
Two issues caused the macOS release binary to embed hardcoded
/opt/homebrew paths, making it fail on systems without Homebrew:

1. /opt/homebrew/lib was unconditionally appended to LLVM_LIBRARY_DIRS,
   causing find_library to discover Homebrew's LLD dylibs (whose
   LC_ID_DYLIB points to /opt/homebrew/opt/lld/lib/...). Guard this
   behind NOT C3_FETCH_LLVM so it only applies when using a
   system-installed LLVM.

2. In the static linking block (C3_LINK_DYNAMIC=OFF), find_library NAMES
   listed .dylib before .a, so shared libraries were preferred even when
   static linking was intended. Reorder to prefer .a, keeping .dylib as
   a fallback for systems that only ship shared libraries.

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
2026-02-08 13:57:07 +01:00
Christoffer Lerno
de0b317461 Fix default main template. 2026-02-08 13:38:43 +01:00
Christoffer Lerno
21758476d4 - For c3c init with library templates, provide example exported functions. #2898 2026-02-07 21:31:12 +01:00
Christoffer Lerno
b69f78be30 Flag --cpu-flags doesn't work if the first item is an exclusion. #2905 2026-02-07 21:21:57 +01:00
Christoffer Lerno
89b9f52f1e Add libc mktemp and tempnam. Update test. 2026-02-07 20:25:28 +01:00
Christoffer Lerno
02a67254cc Fix win forwarding functions. 2026-02-07 19:57:43 +01:00
Manuel Barrio Linares
120f56ac5f disable --fetch-msvc when no curl 2026-02-07 01:22:54 +01:00
Laura Kirsch
5b93212f43 Added Xorshiro128++ random number generator. (#2846)
* Added Xorshiro128++ random number generator.

* Fixes to xorshiro implementation + tests.

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
2026-02-06 20:14:56 +01:00
Zack Puhl
c57415ea78 Optional byte limit for readline
---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
Co-authored-by: Christoffer Lerno <christoffer.lerno@gmail.com>
2026-02-06 19:15:29 +01:00
Manuel Barrio Linares
36dfbdff45 implement progress bar for fetch-msvc
using deterministic milestones
2026-02-06 17:59:36 +01:00
Christoffer Lerno
d07e454dfe Fix missing ) 2026-02-06 17:56:40 +01:00
Christoffer Lerno
40aa4d4dcd Add Murmur3 hash 2026-02-06 17:53:19 +01:00
Manu Linares
0be291e0d7 compiler: added c3c fetch-msvc command (#2854)
* compiler: added `c3c fetch-msvc` command
ported `msvc_build_libraries.py` to built-in compiler 'fetch-msvc'
subcommand.
* fix alpine build
* fix windows build
* fix WinHTTP download to correctly handle full URLs by splitting hostname and path.
* fix old `cp` and escape args for `file_copy_file`
also cleanup the temp directory when we are finished
it would be better to use a cache :|
* remove msiextract dependency
* Auto-fetch `msvc_sdk` if missing
- auto trigger `msvc_sdk` download when compiling for Windows if no SDK
is detected.
- make native Windows SDK detection non-fatal to allow fallback to the
portable SDK
- add debug logging for diagnostics
* removed the LZX decompression logic
- moved `msvc_sdk` to user cache locations to avoid permission issues.
- refined terminal messaging for better accuracy and clarity.
* use %LOCALAPPDATA% on Windows
* Add support for C3_MSVC_SDK
* Update release notes.

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
2026-02-06 14:01:49 +01:00
Manuel Barrio Linares
35d84390bd Simplify CI, do more with less.
- Rename Docker job to **"LLVM ${{ matrix.llvm_version }}
Compatibility"** for better visibility.
- Limit `build_type` to **Debug** for MSYS2, OpenBSD, NetBSD, and Nix
jobs to reduce CI time.
- Refactor **Alpine Linux** job: updated to 3.23, simplified dependency
installation, and removed redundant LLVM matrix.
- Modernize **Docker** builds:
    - Added automatic architecture detection (x86_64/ARM) for CMake
downloads.
    - Generalized LLVM repository logic to support multiple Ubuntu
codenames (Focal/Jammy/Noble).
    - Fixed git permissions issues in containerized builds using
`safe.directory`.
- Standardized Android build packaging and added conditional testing for
Debug builds.
2026-02-06 12:00:00 +01:00
Christoffer Lerno
124efb2684 Improve error message on const int* 2026-02-06 02:00:26 +01:00
Christoffer Lerno
5c158e481b Always have wmain. Cleanup synthetic main generation. Some cleanup for generics. 2026-02-06 01:28:19 +01:00
Christoffer Lerno
42b79d19c1 Update all stub methods. 2026-02-06 00:55:57 +01:00
Zack Puhl
4521a25284 [stdlib] Add PEM Encoding/Decoding Module (#2858)
* [stdlib] Add PEM Encoding/Decoding Module
* release notes
* Removed some unnecessary macro usages. Fixed memory handling with headers.
* Make end of line a parameter. Internal encode method -> function. Use more tmem. Remove t-functions.
* Update API

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
Co-authored-by: Christoffer Lerno <christoffer.lerno@gmail.com>
2026-02-06 00:01:07 +01:00
Foxy-Boxes
1933d47ba1 add Intel user interrupt instructions (#2767)
* add Intel user interrupt instructions

* Example code did not actually work, so was removed.

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
2026-02-05 20:56:35 +01:00
Book-reader
bb9e9b54cf Improve android support & add CI (#2664)
* Change context destruction order.

* enable emulated tls on termux

* Fix stdlib on android

* Add a CI workflow for android termux

* update release notes

* use the new unified CI tests on android

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
2026-02-05 20:04:16 +01:00
Manu Linares
eddbfb8ba3 CMakeLists and CI: Use our custom llvm (#2893)
* c3-llvm: new CMakeLists and CI

uses custom llvm version 21.x from
"https://github.com//ManuLinares/llvm-custom-builds/"

* use c3lang/llvm-for-c3 latest release

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
2026-02-05 18:55:09 +01:00
Christoffer Lerno
2c55d6e220 Further fix shadowing of generics 2026-02-05 18:43:54 +01:00
Christoffer Lerno
472c49de25 Differentiate errors on generic mismatch. 2026-02-05 16:20:17 +01:00
Christoffer Lerno
016254d38c Improve error message when using functions as values #2856 2026-02-05 16:03:56 +01:00
Christoffer Lerno
054fcd2deb Update advice when an enum is found with "= 2" and no associated values. 2026-02-05 13:57:35 +01:00
Christoffer Lerno
d71aa10f62 - Const inline enums would not always implicitly get converted to the underlying type.
- Update to dstring.append_string to take any type converting to String.
2026-02-05 13:04:57 +01:00
Christoffer Lerno
1d0aef4522 Remove unnecessary macro. 2026-02-05 02:07:42 +01:00
Christoffer Lerno
71b673d241 - Shadowing not detected for generic declarations #2876 2026-02-05 01:33:47 +01:00
Christoffer Lerno
dcf695c726 Fix list[0].i = 5 when list[0] returns a pointer. #2888 2026-02-05 00:34:17 +01:00
Christoffer Lerno
5e656603a5 - Remove dependency on temp allocator in File.open. 2026-02-04 14:27:52 +01:00
Christoffer Lerno
b4426c095b - Remove dependency on temp allocator in String.join. 2026-02-04 13:06:12 +01:00
Christoffer Lerno
5f32c97094 - Compiler crash when using arrays of vectors in lists. #2889 2026-02-04 12:40:16 +01:00
Christoffer Lerno
1c8cb7fa11 Method resolution and $define now works together well unless definitions are out of order for real. 2026-02-04 12:23:37 +01:00
Christoffer Lerno
6bc606a9b1 Removed analyse top pass. Remove sub module tracking. Fix errors where ? should be ~ 2026-02-02 12:20:34 +01:00
Christoffer Lerno
d509b4caa1 Updated info about contributing bindings. 2026-01-31 22:07:14 +01:00
Zack Puhl
12975d07ac [stdlib] Reduce inline code volume from sorting macros (#2831)
* reduce codegen in sorting macros

* remove testing file...

* Fix and some renaming, removing some sub-modules that should not be in use.

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
2026-01-31 20:19:57 +01:00
Laura Kirsch
3d512abaf7 Fix non-LLVM build. 2026-01-31 14:07:48 +01:00
Kiana
a9d93c93d5 Improve linker error message (#2880)
* Improve linker error message

* use file_util/file_is_dir instead

* cleanup unused function

* Some minor updates and merging latest master.

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
2026-01-31 04:55:47 +01:00
Manu Linares
1b7601fdbb stdlib: optimize math::next_power_of_2 to O(1) using hardware CLZ (#2839)
* stdlib: optimize math::next_power_of_2 to O(1) using hardware CLZ

- updated DString.reserve to use this

* bit smearing

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
2026-01-31 00:20:58 +01:00
Smite Rust
373013046d Fix formatting of path assignment in msvc_build_libraries.py 2026-01-30 22:01:40 +01:00
Christoffer Lerno
10d369d766 Updated grammar, and 0.7.10 first commit 2026-01-30 21:59:20 +01:00
Christoffer Lerno
161280ce7d Add deprecation silence notice. v0.7.9 2026-01-30 13:57:52 +01:00
Christoffer Lerno
4e129d4ae2 Fix test. 2026-01-30 13:18:56 +01:00