Commit Graph

194 Commits

Author SHA1 Message Date
gingerBill
6d1eb473cf Correct \n ignore rules 2021-04-26 21:25:44 +01:00
gingerBill
cb2e6ea31d Remove use_llvm_api related checks and other related things 2021-04-25 20:03:05 +01:00
gingerBill
05a181d719 Fix style issues; Use new attribute @(cold) where appropriate in the new sync package 2021-04-14 20:19:02 +01:00
Jeroen van Rijn
aca5c7c1c6 Placate -vet. 2021-04-13 02:18:47 +02:00
Jeroen van Rijn
a1d871360c Add support to core:windows to add/delete users.
main :: proc() {

	using fmt;
	using windows;

	username := "testuser";
	password := "testpass";

	ok := add_user("", username, password);
	fmt.printf("add_user: %v\n", ok);
	pi := windows.PROCESS_INFORMATION{};

	ok2, path := windows.add_user_profile(username);
	fmt.printf("add_user_profile: %v, %v\n", ok2, path);

	ok3 := windows.delete_user_profile(username);
	fmt.printf("delete_user_profile: %v\n", ok3);

	ok4 := windows.delete_user("", username);
	fmt.printf("delete_user: %v\n", ok4);

	// Has optional bool to not wait on the process before returning.
	b := run_as_user(username, password, "C:\\Repro\\repro.exe", "Hellope!", &pi);
	fmt.printf("run_as_user: %v %v\n", b, pi);
}
2021-04-13 02:09:44 +02:00
gingerBill
359ae29d98 Minor fixes 2021-03-18 13:25:41 +00:00
gingerBill
a60d22fefd Make trailing comma usage consistent 2021-03-13 21:18:07 +00:00
gingerBill
b727b6438b Minimize unneeded casts 2021-03-03 14:31:17 +00:00
nakst
7b4ddd9b18 update essence API header 2021-02-26 14:46:38 +00:00
gingerBill
6988b12012 Replace inline with #force_inline in sys/es/api.odin 2021-02-23 16:15:37 +00:00
gingerBill
aa93305015 Replace usage of inline proc with #force_inline proc in the core library 2021-02-23 16:14:47 +00:00
gingerBill
fe33a64b2e Remove #opaque usage in core library 2021-02-23 15:21:05 +00:00
gingerBill
efdee0dafb Remove bit_field type from Odin (keyword and dead runtime code still exists) 2021-02-19 11:31:14 +00:00
gingerBill
5cced38a6e Add kernel32 memory api 2021-02-11 15:31:51 +00:00
gingerBill
f50ea36c70 Fix miscorrect type usage 2021-02-04 14:24:42 +00:00
gingerBill
de9b6e3f6e Correct sys/win32 to match sys/windows 2021-02-04 13:50:48 +00:00
gingerBill
f0683c9102 Merge branch 'master' into parser-experiments 2020-12-06 00:49:48 +00:00
gingerBill
fd453be831 Deprecate opaque in favour of #opaque in the core library 2020-12-04 18:49:39 +00:00
Dan Bechard
58f768cb4f Update kernel32.odin
Fix typo in CreateProcessA/W mappings (https://github.com/odin-lang/Odin/issues/785)
2020-11-20 15:39:08 -08:00
gingerBill
7c5247f5fb Add package sys/cpu - implements processor feature detection 2020-11-06 00:39:09 +00:00
gingerBill
54fbdabc38 Add experimental -insert-semicolon functionality to tokenizer and parser 2020-11-01 15:10:06 +00:00
zhibog
05b58bdbb1 Fixed package name 2020-10-24 00:17:36 +02:00
zhibog
4c4112fbc7 Fixed getting windows version. The former function is no longer working on Windows 10. Also fixed the struct to use correct win32 names 2020-10-24 00:14:01 +02:00
gingerBill
fa33476438 Improve default temp allocator; Fix filepath.abs behaviour on Windows 2020-10-13 14:40:13 +01:00
gingerBill
1818ceb4f2 Merge pull request #747 from Platin21/master
Fixes for MacOS 11 / Big Sur
2020-09-28 12:48:50 +01:00
gingerBill
9ae3879956 Add os.stat, os.lstat, os.fstat, filepath.walk 2020-09-28 12:28:02 +01:00
Platin21
a71cbd4087 Changed foreign imports to now use the System Framework 2020-09-27 21:57:27 +03:00
gingerBill
840af6825a Update packages os, path, and filepath 2020-09-26 16:02:03 +01:00
gingerBill
8cc5cd1494 Add package path/filepath; Add os.stat for windows (TODO: unix) 2020-09-25 20:20:53 +01:00
gingerBill
fc4fdd588e Remove usage of do in core library 2020-09-23 17:17:14 +01:00
nakst
c92860e142 update essence platform 2020-09-15 23:22:19 +01:00
Christian Seibold
a13eed9894 Cleanup, check sched_param and SCHED_* constants in pthread_freebsd.odin 2020-09-15 01:34:01 -05:00
Christian Seibold
65787381c1 Change sizes of pthread types for freebsd 2020-09-14 16:48:55 -05:00
Christian Seibold
577be4a8ae Get Odin compiling and produced exe's running on FreeBSD 2020-09-14 15:22:35 -05:00
gingerBill
7f48cf8405 [REFLECTION BREAKING] Modify the internals of the map type to increase performance 2020-09-07 11:41:42 +01:00
gingerBill
9cc20954a3 Add sys/windows/synchronization.odin 2020-08-02 15:07:52 +01:00
gingerBill
6d032e6f1a Update package sync 2020-08-02 15:01:17 +01:00
Clay Murray
83eabe2140 Fix pthread_t on Macos.
From some testing with directly using C code, pthread_t on macos is 8 bytes.
This is my test code:

```
#include <assert.h>
#include <stdio.h>

#include <pthread.h>



void* PosixThreadMainRoutine(void* data)

{

	// Do some work here.
	for (int i = 0; i < 2000000000; i++) {

	}



	return NULL;

}



pthread_t LaunchThread()

{

	// Create the thread using POSIX routines.

	pthread_attr_t  attr;

	pthread_t       posixThreadID;

	int             returnVal;



	returnVal = pthread_attr_init(&attr);

	assert(!returnVal);

	returnVal = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);

	assert(!returnVal);



	int     threadError = pthread_create(&posixThreadID, &attr, &PosixThreadMainRoutine, NULL);



	returnVal = pthread_attr_destroy(&attr);

	assert(!returnVal);

	if (threadError != 0)

	{

		// Report an error.

	}

	return posixThreadID;

}

int main() {
	pthread_t t = LaunchThread();

	void ** ret;


	printf("%d, %d\n", sizeof(t), sizeof(pthread_t));

	int val = pthread_join(t, ret);


	printf("%d", val);
	return 0;
}
```
running this on macos reports `8, 8`. 
Then I made the proposed changes and errors I was having with threads completely went away.
2020-07-11 18:22:56 -06:00
gingerBill
c4067372dd Fix double declaration 2020-07-10 22:28:48 +01:00
gingerBill
642afa4f88 Fix new package path 2020-07-10 08:42:22 +01:00
gingerBill
f65fa0e4a6 Merge pull request #339 from dotbmp/master
"core:path" Path library and "core:strings" `split` Utilities
2020-07-10 08:25:24 +01:00
gingerBill
858c5f8fd8 Update thread_unix logic 2020-06-27 11:36:48 +01:00
gingerBill
f92b4c7849 Update sys/unix; Rename thread.create_and_start 2020-06-27 11:26:38 +01:00
gingerBill
2b18f43b65 Update sys/windows; Add sync.Blocking_Mutex (windows only at the moment) 2020-06-27 00:59:40 +01:00
gingerBill
53e1512978 Add more exception handling stuff to sys/windows 2020-06-26 20:42:17 +01:00
gingerBill
bb81d4869f Update sys/windows 2020-06-26 20:09:31 +01:00
gingerBill
6bd05ef5d7 Begin migration from sys/win32 to sys/windows 2020-06-26 19:11:34 +01:00
vassvik
9cccb20f49 Add some tests to test utf16_to_utf8 and wstring_to_utf8 2020-06-13 18:04:19 +02:00
vassvik
0056cdffa7 Reworked win32.utf16_to_utf8 and win32.wstring_to_utf8 to scan for zeros from the start of the string instead of from the end.
This is useful to correctly convert strings from a buffer possibly containing multiple multiple substrings.

The resulting utf8 string is not null terminated, even if the backing memory might be null terminated.
2020-06-13 15:19:41 +02:00
vassvik
bbbf7168f1 Add wstring_to_utf8 to sys/win32 2020-06-12 21:06:21 +02:00