Skip to content

Instantly share code, notes, and snippets.

View MisterDA's full-sized avatar
💾
furiously hacking

Antonin Décimo MisterDA

💾
furiously hacking
  • Paris, France
  • 12:16 (UTC +01:00)
View GitHub Profile
@MisterDA
MisterDA / main.c
Last active October 11, 2024 16:02
Portable deprecation notice for C compilers
#ifndef __has_attribute
#define __has_attribute(x) 0
#endif
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L || \
defined(__cplusplus) && __cplusplus >= 201402L
#define CAMLdeprecated(name, replacement) \
[[deprecated("use '" #replacement "' instead")]]
#elif __has_attribute(deprecated) || defined(__GNUC__)
#define CAMLdeprecated(name, replacement) \
@MisterDA
MisterDA / script.sh
Created July 10, 2024 07:59
cppcheck for OCaml
#!/bin/sh
# - Problems with parsing C, use --clang?
# - Problems with seemingly unused variables, recognize __attribute__ ((unused))?
./configure --disable-ocamldoc && bear -- make
cppcheck --project=compile_commands.json --quiet \
--std=c11 \
--check-level=exhaustive --enable=all \
--suppress=missingIncludeSystem --suppress=unusedFunction
@MisterDA
MisterDA / .gitignore
Last active December 5, 2023 16:39
Test TLS callbacks on Windows
*.obj
*.lib
*.exe
*.dll
*.o
*.a
.\" Pipe this output to groff -m man -K utf8 -T utf8 | less -R
.\"
.mso an.tmac
.TH "OBUILDER" 1 "" "Obuilder" "Obuilder Manual"
.\" Disable hyphenation and ragged-right
.nh
.ad l
.SH NAME
.P
obuilder \N'45' a command\N'45'line interface for OBuilder
all:
groff -m man -T utf8 noop-escaped.man | less -R
@MisterDA
MisterDA / .gitignore
Last active February 16, 2022 08:33
OCaml win32unix: kill an arbitrary process?
_build/
_opam/
*.install
@MisterDA
MisterDA / ocaml-platform-contributions.md
Last active June 15, 2020 19:02
My contributions to the OCaml ecosystem.
From 07fd30f6cdbfb229519e41de48cbda50f8f22fd2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= <antonin.decimo@gmail.com>
Date: Tue, 31 Mar 2020 00:12:07 +0200
Subject: [PATCH] Set executable version to pkgver
---
PKGBUILD | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/PKGBUILD b/PKGBUILD
@MisterDA
MisterDA / config
Created March 10, 2020 14:30
Sway configuration
# Default config for sway
### Variables
#
# Logo key. Use Mod1 for Alt.
set $mod Mod4
# Home row direction keys, like vim
set $left h
set $down j
set $up k