Skip to content

Instantly share code, notes, and snippets.

View gvanem's full-sized avatar

Gisle Vanem gvanem

View GitHub Profile
@gvanem
gvanem / Makefile.Windows
Last active December 23, 2021 13:01
GNU-makefile for the SDR-Radio program Quisk
#
# GNU Makefile for the SDR-Radio program Quisk.
#
# Supporting MinGW only. MSVC or clang-cl is not possible due
# to lack of C99 "complex types" support.
#
# By G. Vanem <[email protected]> 2020 - 2021.
#
# Ref: http://james.ahlstrom.name/quisk/
# https://pypi.org/project/quisk/#files
@gvanem
gvanem / Makefile.Windows
Last active April 26, 2023 22:20
Wget2 stuff for Windows (clang-cl): added 'libwget/mswindows.[ch]' and 'Makefile.Windows'.
#
# GNU Makefile for Wget2 (MSVC and clang-cl).
# 32-bit only.
#
# By <[email protected]> 2015 - 2021.
#
THIS_FILE = Makefile.Windows
THIS_DIR = $(realpath .)
comma := ,
@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)