Commit Graph

6023 Commits

Author SHA1 Message Date
gingerBill f2f1330238 Add https://github.com/odin-lang/examples 2022-04-08 10:29:23 +01:00
Mikkel Hjortshøj 8a8b5c753f Update README.md 2022-04-07 16:48:34 +02:00
gingerBill 426a6a9528 Update nightly.yml to build the directory 2022-04-05 21:10:24 +01:00
Jeroen van Rijn 50b9c48609 Merge pull request #1697 from Kelimion/build_file
Give build/run/check/test/doc a `-file` flag.
2022-04-05 20:52:28 +02:00
Jeroen van Rijn 767ed21bfe -file for tests\issues. 2022-04-05 20:47:37 +02:00
Jeroen van Rijn bb9165edd2 Add -help to CI tests. 2022-04-05 20:45:00 +02:00
Jeroen van Rijn ad0a413b40 Give build/run/check/test/doc a -file flag.
A package has canonically always been a directory, but odin allowing you to build a single-file package confused newcomers who didn't understand why they could then not access variables and procedures from another file in the same directory.

This change disallows building single-file packages by default, requiring the `-file` flag to acknowledge you understand the nuance.

`-help` for these commands also clarifies the difference.

```
W:\Odin>odin build -help
odin is a tool for managing Odin source code
Usage:
        odin build [arguments]

        build   Compile directory of .odin files as an executable.
                One must contain the program's entry point, all must be in the same package.
                Use `-file` to build a single file instead.
                Examples:
                        odin build .                    # Build package in current directory
                        odin build <dir>                # Build package in <dir>
                        odin build filename.odin -file  # Build single-file package, must contain entry point.

        Flags

        -file
                Tells `odin build` to treat the given file as a self-contained package.
                This means that `<dir>/a.odin` won't have access to `<dir>/b.odin`'s contents.
```

```
W:\Odin>odin run examples\demo\demo.odin
ERROR: `odin run` takes a package as its first argument.
Did you mean `odin run examples\demo\demo.odin -file`?
The `-file` flag tells it to treat a file as a self-contained package.
```
2022-04-05 20:26:18 +02:00
gingerBill ca549939f3 Update README.md 2022-04-05 13:33:25 +01:00
gingerBill cdb003bf23 Add Packages and Nightly Builds to README.md 2022-04-05 13:32:06 +01:00
gingerBill a4d2ff05a9 Merge pull request #1688 from bkrypt/fix_file_windows_open_create_append_order
os/file_windows: Fix "create or append" file open behavior
2022-04-05 12:29:20 +01:00
gingerBill 48012ec73c Merge pull request #1679 from Tetralux/fix-std-handle
Have get_std_handle() no longer make the handles uninheritable
2022-04-05 12:15:14 +01:00
Jeroen van Rijn e7dc00b758 Merge pull request #1695 from ftphikari/master
sys/windows: add Dwmapi.lib binding
2022-04-05 13:10:52 +02:00
hikari ef1fbbbce6 Merge branch 'master' of github.com:ftphikari/Odin 2022-04-05 14:04:03 +03:00
hikari 2a59aebe5b sys/windows: add Dwmapi.lib binding 2022-04-05 14:03:29 +03:00
gingerBill 59025b75ba Merge branch 'master' of https://github.com/odin-lang/Odin dev-2022-04 2022-04-04 17:04:12 +01:00
gingerBill 2289b7a33d Remove #caller_location from certain calls in core:container/small_array 2022-04-04 17:04:05 +01:00
Jeroen van Rijn 79ec172797 Merge pull request #1694 from Kelimion/define_help
Add extra help line for define/config.
2022-04-03 21:11:19 +02:00
Jeroen van Rijn 2e6ad2a711 Add extra help line for define/config. 2022-04-03 21:06:06 +02:00
Jeroen van Rijn 6be05f315d Merge pull request #1693 from Skytrias/skytrias-strings-documentation-rest
documentation for the rest of the strings library
2022-04-03 19:54:19 +02:00
Michael Kutowski b5aa50aaa4 documentation for the rest of the strings library 2022-04-03 19:37:54 +02:00
Jeroen van Rijn ab91fa6ad5 Merge pull request #1692 from Kelimion/easy_font
[vendor:easy_font] API improvements.
2022-04-03 19:08:18 +02:00
Jeroen van Rijn 376327c87b [vendor:easy_font] API improvements.
Add `print(x, y, text, color, quad_buffer)` version that takes `[]quad`.
		(Same internal memory layout as []u8 API, but more convenient for the caller.)
Add optional `scale := f32(1.0)` param to `print` to embiggen the glyph quads.

```odin
	// Example for use with vendor:raylib

	quads: [999]easy_font.Quad = ---

	color := rl.GREEN
	c     := transmute(easy_font.Color)color
	num_quads := easy_font.print(10, 60, TEXT, c, quads[:])

	for q in quads[:num_quads] {
		tl    := q.tl.v
		br    := q.br.v
		color  = transmute(rl.Color)q.tl.c

		r := rl.Rectangle{x = tl.x, y = tl.y, width = br.x - tl.x, height = br.y - tl.y}

		// Yes, we could just use the `color` from above, but this shows how to get it back from the vertex.
		// And in practice this code will likely not live as close to the `easy_font` call.
		rl.DrawRectangleRec(r, color)
	}
```
2022-04-03 18:53:27 +02:00
Jeroen van Rijn f8f91e52e0 Merge pull request #1691 from eisbehr/stb_easy_font_fix
Fixes for stb_easy_font
2022-04-03 15:30:52 +02:00
Florian Behr f4daf46ff4 Fixes for stb_easy_font 2022-04-03 15:18:01 +02:00
bkrypt e80bee6867 Change order of O_CREATE & O_APPEND checks 2022-04-02 21:55:01 +02:00
gingerBill d10d54710c Merge pull request #1686 from Kelimion/compile-time-assert
Allow optional message for `#assert`.
2022-04-02 15:02:46 +01:00
gingerBill 1ec997461d Add extra checks to atomic intrinsics 2022-04-02 15:00:28 +01:00
gingerBill ec5fc10988 Merge branch 'master' of https://github.com/odin-lang/Odin 2022-04-02 14:38:51 +01:00
gingerBill a232c0888c intrinsics.atomic_type_is_lock_free 2022-04-02 14:38:42 +01:00
Jeroen van Rijn cb5a6b531a Allow optional message for #assert. 2022-04-02 15:31:50 +02:00
Jeroen van Rijn c930a3b4c8 Merge pull request #1685 from ftphikari/master
sys/windows: add a couple of procedures and types
2022-04-02 12:55:51 +02:00
hikari 4c14e92952 sys/windows: add several procedures and macros 2022-04-02 08:23:12 +03:00
hikari 850d4a1e1b sys/windows: add a couple of procedures and types 2022-04-02 07:38:11 +03:00
Jeroen van Rijn dc012ed6dd Merge pull request #1682 from ftphikari/master
sys/windows: add intrinsics.constant_utf16_cstring
2022-04-02 03:27:58 +02:00
Jeroen van Rijn c21c993646 [strings] fix. 2022-04-02 01:54:35 +02:00
gingerBill c3a292a8c7 Remove hms2019 files 2022-04-02 00:36:26 +01:00
Jeroen van Rijn 4044a577cc Merge pull request #1683 from Kelimion/big_nails
[math/big] Tell Python test runner how many nails we use.
2022-04-01 16:33:30 +02:00
Jeroen van Rijn 581d53b96b [math/big] Tell Python test runner how many nails we use.
`_DIGIT_NAILS` is defined as 4, meaning that we use 60 out of every 64 bits.
We can use as few as 1 nail, using 63 bits out of every 64, and all tests will still pass.

However, it needs more testing to see if that's a worthwhile change to make.

For the tests to work properly when changing the nails, Python needs to know about it as well.

In addition, compile the big math code with `-o:speed` going forward.
2022-04-01 16:24:27 +02:00
gingerBill 2bc89260f1 Add explicit memory ordering for the internal Sema implementation 2022-04-01 15:08:58 +01:00
gingerBill c78b83f142 Fix _Sema 2022-04-01 14:51:51 +01:00
hikari e28525e28c sys/windows: fix some procedure definitions and types 2022-04-01 07:28:18 +03:00
hikari 73f9d12d47 sys/windows: add various procedures 2022-04-01 06:22:27 +03:00
hikari b21cf05d44 sys/windows: move L into util.odin 2022-04-01 02:25:10 +03:00
hikari 107bede9fd sys/windows: fix building error 2022-04-01 02:23:44 +03:00
hikari 75cbb09744 sys/windows: add intrinsics.constant_utf16_cstring 2022-04-01 02:11:41 +03:00
Jeroen van Rijn 76cf667a29 Merge pull request #1681 from colrdavidson/fix-nightly
only install the right version of llvm
2022-03-31 22:47:37 +02:00
Colin Davidson 78ee97ec74 only install the right version of llvm 2022-03-31 13:40:28 -07:00
Tetralux c686133172 Have get_std_handle() no longer make the handles uninheritable
This caused all handles returned by GetStdHandle() to also not be inheritable,
which prevents you from handing them to child processes that you might create.

This fixes that.
2022-03-31 17:03:12 +00:00
gingerBill bfcd7a35bf Merge pull request #1621 from colrdavidson/build_freebsd
Core out Makefile, add freebsd building
2022-03-31 16:25:37 +01:00
gingerBill 4484a3433d Update mem.nil_allocator to match the same in runtime 2022-03-31 15:03:56 +01:00