Skip to content

Instantly share code, notes, and snippets.

View denwarenjii's full-sized avatar

Christian Miranda denwarenjii

View GitHub Profile
@mmozeiko
mmozeiko / armv8_tsc.h
Last active September 10, 2025 03:48
armv8 timer & cycle counter
#pragma once
#if defined(__linux__)
# define _GNU_SOURCE
# include <sched.h>
# include <unistd.h>
# include <sys/syscall.h>
# include <linux/perf_event.h>
#elif defined(_WIN32)
# include <intrin.h>
@mmozeiko
mmozeiko / !README.md
Last active December 6, 2025 21:26
Download MSVC compiler/linker & Windows SDK without installing full Visual Studio

This downloads standalone MSVC compiler, linker & other tools, also headers/libraries from Windows SDK into portable folder, without installing Visual Studio. Has bare minimum components - no UWP/Store/WindowsRT stuff, just files & tools for native desktop app development.

Run py.exe portable-msvc.py and it will download output into msvc folder. By default it will download latest available MSVC & Windows SDK from newest Visual Studio.

You can list available versions with py.exe portable-msvc.py --show-versions and then pass versions you want with --msvc-version and --sdk-version arguments.

To use cl.exe/link.exe first run setup_TARGET.bat - after that PATH/INCLUDE/LIB env variables will be updated to use all the tools as usual. You can also use clang-cl.exe with these includes & libraries.

To use clang-cl.exe without running setup.bat, pass extra /winsysroot msvc argument (msvc is folder name where output is stored).

@g-berthiaume
g-berthiaume / Useful GCC Compiler Options.md
Created December 31, 2018 18:27
A useful list of gcc compiler options

Useful GCC Compiler Options

A non exhaustive list of gcc compiler options.

$ gcc myprog.c -o myprog -Wall -Wextra -pedantic -std=c11 [...]

Optimization: