Skip to content

Instantly share code, notes, and snippets.

View gvanem's full-sized avatar

Gisle Vanem gvanem

View GitHub Profile
@gvanem
gvanem / run_test.py
Created September 25, 2021 17:19
RTL_433 test script
#!/usr/bin/env python3
"""Compare actual output Json-formatted output lines of
rtl_433 with reference json."""
import sys
import os
import argparse
import fnmatch
@gvanem
gvanem / Makefile.Windows
Last active September 9, 2021 11:57
A GNU-makefile for DearPyGui (MSVC / clang-cl)
#
# GNU Makefile for DearPyGui (MSVC / clang-cl).
#
# By G. Vanem <[email protected]> 2021.
#
# Ref: https://github.com/hoffstadt/DearPyGui.git
#
TODAY = $(shell date +%d-%B-%Y)
THIS_FILE = $(firstword $(MAKEFILE_LIST))
@gvanem
gvanem / test-MMDB.c
Last active November 6, 2020 10:49
A small test program for MaxMind's MMDB-datafiles.
#include <string.h>
#include <time.h>
#include <maxminddb.h>
static MMDB_s g_mmdb = { 0 };
#define MAX_wchar_COUNTRY_NAME 50
typedef wchar_t mmdb_wname [MAX_wchar_COUNTRY_NAME];
@gvanem
gvanem / Makefile.Windows
Last active September 23, 2020 19:19
MicroPython. GNU-makefile and a 'lib_main.c' for MSVC or clang-cl.
#
# Gnu Makefile for MicroPython (MSVC or clang-cl).
#
# This Makefile MUST be placed in the root-directory of your MicroPython installation.
#
# By G. Vanem <[email protected]> 2020.
#
THIS_FILE = Makefile.Windows
TODAY = $(shell date +%d-%B-%Y)
@gvanem
gvanem / Asan-test.c
Created July 26, 2020 09:15
Test the new ASAN feature of MSVC
/*
* Test the new ASAN feature of MSVC (ripped from clang presumably).
*
* Ref:
* https://devblogs.microsoft.com/cppblog/addresssanitizer-asan-for-windows-with-msvc/
*/
#include <stdlib.h>
/*
* Ref 'https://github.com/google/sanitizers/wiki/AddressSanitizerFlags'
--- a/libfilezilla/lib/util.cpp 2020-07-01 12:30:29
+++ b/libfilezilla/lib/util.cpp 2020-07-04 15:32:17
@@ -125,8 +125,22 @@
uint64_t bitscan(uint64_t v)
{
-#if !FZ_WINDOWS || defined(__MINGW32__) || defined(__MINGW64__)
+#if !FZ_WINDOWS || defined(__MINGW32__) || defined(__MINGW64__) || defined(__clang__)
return __builtin_ctzll(v);
+#elif defined(_M_IX86)
@gvanem
gvanem / Makefile.Windows
Last active March 15, 2020 21:03
GNU makefile for MPIR targeting MinGW + MSVC + clang-cl. Ref: https://github.com/BrianGladman/mpir.git
#
# MPIR Makefile for MinGW + MSVC + clang-cl.
#
# by G. Vanem <[email protected]> 2004-2020.
#
comma := ,
DATE = $(shell date +%d-%B-%Y)
VER_MAJOR := $(shell grep -m1 __GNU_MP_VERSION gmp-h.in | cut -d' ' -f3)
VER_MINOR := $(shell grep -m1 __GNU_MP_VERSION_MINOR gmp-h.in | cut -d' ' -f3)
@gvanem
gvanem / Makefile.Windows
Last active March 2, 2024 14:29
Python 3.x Makefile for MSVC and clang-cl (x86/x64)
#
# GNU-Makefile for Python 3.x.
#
# Targeting Windows 32 + 64-bits using MSVC-201x or clang-cl.
#
# By G. Vanem <[email protected]> 2015 - 2022.
#
THIS_FILE = Makefile.Windows
DATE := $(shell date +%d-%B-%Y)
@gvanem
gvanem / Makefile.MSVC
Last active November 28, 2019 14:13
A Gnu-Makefile for Doxygen (targeting MSVC or clang-cl)
#
# GNU-makefile for Doxygen (MSVC / clang-cl, 32-bit)
#
# By G. Vanem <[email protected]> 2019.
#
THIS_FILE := Makefile.MSVC
DEP_FILE := .depend.MSVC
DATE := $(shell date +%d-%B-%Y)
#
@gvanem
gvanem / snmpmgr.c
Created August 20, 2019 16:17
A simple SNMP-manager using libcurl (Win32 only).
/*****************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2018, Daniel Stenberg, <[email protected]>, et al.
*
* This software is licensed as described in the file COPYING, which