Skip to content

Instantly share code, notes, and snippets.

View SuperPaintman's full-sized avatar
🐻
Nice!

Aleksandr Krivoshchekov SuperPaintman

🐻
Nice!
View GitHub Profile
@SuperPaintman
SuperPaintman / result.h
Last active March 3, 2018 11:56
Rust flavored error handling for C
#ifndef RESULT_H_
#define RESULT_H_
// Includes
#include <stdbool.h>
#include <stdint.h>
// Macros
#define RESULT_TEMPLATE(name, typeOk, typeErr) \
typedef struct name { \