Skip to content

Instantly share code, notes, and snippets.

View actboy168's full-sized avatar
😸

actboy168 actboy168

😸
  • China
  • 01:15 (UTC +08:00)
View GitHub Profile
@actboy168
actboy168 / int128.h
Created April 7, 2024 16:36
int128.h
#pragma once
#if defined(_MSC_VER) && !defined(__clang__)
#include <__msvc_int128.hpp>
namespace bee {
using int128_t = std::_Signed128;
using uint128_t = std::_Unsigned128;
}
#else
namespace bee {
local lm = require "luamake"
lm:exe "minilua" {
defines = "_CRT_SECURE_NO_WARNINGS",
sources = {
"src/host/minilua.c"
}
}
local dynasm_flags = {
local error = error
local strchar = string.char
local strbyte = string.byte
local strmatch = string.match
local utf8char = utf8.char
local tconcat = table.concat
local function be_tochar(code)
return strchar((code >> 8) & 0xFF, code & 0xFF)
end
local string_char = string.char
local string_byte = string.byte
local table_concat = table.concat
local pairs = pairs
local encoder = {}
local decoder = {}
for i, char in pairs {
'A','B','C','D','E','F','G','H','I','J', 'K','L','M','N',
'O','P','Q','R','S','T','U','V','W','X','Y', 'Z',
local function if_then(toclose)
if not toclose then
return function() end
end
return function (_, w)
if not w then
return toclose
end
end, nil, nil, toclose
end
local format = string.format
local tonumber = tonumber
local fmt = {
'%.1f',
'%.2f',
'%.3f',
'%.4f',
'%.4f',
'%.5f',
'%.6f',
#pragma once
#include <Dbghelp.h>
#pragma comment(lib, "Dbghelp.lib")
class Symbols {
public:
Symbols()
: m_process(GetCurrentProcess())
{
local slk = {}
local function split(str, p)
local rt = {}
string.gsub(str, '[^'..p..']+', function (w) table.insert(rt, w) end)
return rt
end
local function trim(str)
return string.gsub(str, "^%s*(.-)%s*$", "%1")