- Set CLion Toolchain to WSL
- Settings/Build, Execution & Deployment/Toolchains
- Make sure all checks pass
- If necessary, install C build tools on WSL side
sudo apt-get install build-essential
- From CLion, use File/Open... -> your MakeFile -> "Open as Project" -Note: if your MakeFile does not contain an "all" target, the CLion Makefile plugin thing might get angry and not parse any of the other targets
- Go to "Edit Configurations" (on the upper-right)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // BluetoothLowEnergy.cpp : Defines the entry point for the console application. | |
| // | |
| #include "stdafx.h" | |
| #pragma warning (disable: 4068) | |
| #include <windows.h> | |
| #include <stdio.h> | |
| #include <tchar.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const assert = std.debug.assert; | |
| // uses reflection to byte-swap all members of a packed struct | |
| // layout is preserved | |
| fn byte_swap_all_members(comptime T: type, struct_pointer: *T) void { | |
| comptime assert(@typeInfo(T).Struct.layout != .Auto); | |
| comptime assert(@mod(@bitSizeOf(T), 8) == 0); | |
| var raw_bytes = @ptrCast([*]u8, std.mem.asBytes(struct_pointer)); | |
| comptime var start_index: u32 = 0; | |
| inline for (std.meta.fields(T)) |field| { |
Little book of Semaphores https://greenteapress.com/semaphores/LittleBookOfSemaphores.pdf
https://preshing.com/20150316/semaphores-are-surprisingly-versatile/
Building a Condvar using Futex https://www.remlab.net/op/futex-condvar.shtml