Skip to content

Instantly share code, notes, and snippets.

In file included from C:\zig\romlua\lua-5.3.5\src\lapi.c:16:
In file included from C:\zig\romlua\lua-5.3.5\src/lua.h:13:
C:\zig\zig-windows-x86_64-0.4.0+6b36b756\lib\zig\include\stddef.h:62:23: error: typedef redefinition with different
types ('unsigned long' vs 'unsigned int')
typedef __SIZE_TYPE__ size_t;
^
C:\zig\zig-windows-x86_64-0.4.0+6b36b756\lib\zig\libc\include\generic-musl\bits/alltypes.h:88:24: note: previous
definition is here
typedef unsigned _Addr size_t;
^
const Builder = @import("std").build.Builder;
const builtin = @import("builtin");
pub fn build(b: *Builder) void {
const exe = b.addExecutable("romlua", "romlua.zig");
exe.addCSourceFile("lua-5.3.5/src/lapi.c",[][]const u8{"-std=c99"});
exe.addCSourceFile("lua-5.3.5/src/lauxlib.c",[][]const u8{"-std=c99"});
exe.addCSourceFile("lua-5.3.5/src/lbaselib.c",[][]const u8{"-std=c99"});
exe.addCSourceFile("lua-5.3.5/src/lbitlib.c",[][]const u8{"-std=c99"});
exe.addCSourceFile("lua-5.3.5/src/lcode.c",[][]const u8{"-std=c99"});
@triplefox
triplefox / allocation_death.go
Created March 5, 2019 19:10
Test case for go-glfw dying due to memory allocation
// allocation_death.go
package main
import (
_ "image"
"github.com/go-gl/gl/v4.1-core/gl"
"github.com/go-gl/glfw/v3.2/glfw"
)
# initialize a new allegro-pascal project
my $projectname = "newproject";
my $allegropas-src = "allegro.pas-5.2.a3-src-pas/lib";
if $projectname.IO.e {
say "project $projectname already exists";
} else {
mkdir $projectname or die "$!";
try {
@triplefox
triplefox / FlatXML.hx
Created May 29, 2017 10:01
Flattens all the nuances of Haxe's Xml implementation into an enum, where it's much easier to capture data.
import Xml;
/* Flattens all the nuances of Haxe's Xml implementation
into an enum, where it's much easier to capture data. */
enum FlatXMLNode {
Element(
name : String,
attribute : Map<String,String>,
children : Array<FlatXMLNode>);
package ludamix.bmfont;
import haxe.ds.Vector;
import ludamix.bmfont.BMFont;
using ludamix.MapPair;
class BMFontRenderPage<T> {
public var data : BMFontPage;
public var image : T;
package ludamix;
import haxe.ds.Vector;
class T /*toolbox*/
{
public static inline var TAU = 6.28318530718;
public static inline var EPSILON = 0.0000001;
public static inline function lerpF(r0 : Float, r1 : Float, z : Float) : Float { return (r0 + (r1 - r0) * z); }
{
"haxe.haxeDiagnosticDelay": 2000,
"editor.quickSuggestionsDelay": 1000,
"editor.suggestOnTriggerCharacters": false,
"git.enabled": false,
"files.autoSaveDelay": 1000000000
}
import kha.Assets;
import kha.Image;
import kha.Sound;
import kha.Blob;
import kha.Video;
import kha.Font;
enum KhaAssetRequest {
KARBlob(k : String);
KARImage(k : String);
class AssetCacheData {
public var anim_aset : LifeVector<AnimationAsset>;
public var anim_inst : LifeVector<AnimationRenderable>;
public var hscript : Map<String, HScriptModule>;
public var blob : Map<String, Blob>;
public var image : Map<String, Image>;
public var sound : Map<String, Sound>;
public var font : Map<String, Font>;
public var video : Map<String, Video>;