Skip to content

Instantly share code, notes, and snippets.

// gcc -Os -s -municode -nostartfiles -mfpmath=both -march=core2 -e __main -Wl,-gc-sections win.c -o win -luser32 -lkernel32 -lgdi32 -lopengl32
#include <windows.h>
#include <stdint.h>
#include <gl/gl.h>
#include <stdio.h>
#include <time.h>
typedef struct {
GLfloat x, y;
} Vector2;
// gcc -Os -s -nostartfiles -nostdlib -e __main -Wl,-gc-sections win.c -o win -luser32 -lkernel32
#define UNICODE
#include <windows.h>
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
void _main(){
MSG msg = {0};
WNDCLASS wc = {0};
wc.lpfnWndProc = WndProc;
@TheServer201
TheServer201 / list.c
Last active January 16, 2017 13:25
Serialize with list
typedef struct node {
uint8_t *Elem;
uint16_t Size;
struct node *Next;
} node_t;
void Node_Push(node_t **Head, uint8_t *Elem, uint16_t Size){
node_t *Node = malloc(sizeof(node_t));
Node->Elem = Elem;
Node->Size = Size;
@TheServer201
TheServer201 / btrh.h
Last active November 3, 2016 22:48
Bit Test Reset Jump
#define Btrj(x, y, z) asm goto("btr %0, %1\n\t" \
"jnc %l0 \n\t" \
: "+rm"(x) \
: "r"(y) \
: "cc" \
: z)