This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdint> | |
#include <array> | |
using bitcount_table_t = std::array<int, 256>; | |
template<int n> | |
struct make_bitcount_table_helper { | |
constexpr static auto bitcount(std::uint8_t x) noexcept -> uint8_t { | |
return x==1 or x==0 ? x : (x bitand 1) + bitcount(x>>1); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OBJS = solver.o test.o | |
f90 : $(OBJS) | |
$(CXX) $(LDFLAGS) $^ -o $@ | |
$(OBJS): %.o: %.cpp | |
$(CXX) -c $(CFLAGS) $< -o $@ | |
clean: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
#include <stdlib.h> | |
#include <iso646.h> | |
#include "explode.h" | |
static char** helper(char* str, const char* delim, size_t delim_size, size_t depth) { | |
char* matched_str = strstr(str, delim); | |
char** result; | |
if(matched_str) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pkgbase=mingw-w64-gdbm | |
pkgname=("${MINGW_PACKAGE_PREFIX}-gdbm") | |
pkgver=1.14 | |
pkgrel=1 | |
pkgdesc="GNU database library" | |
arch=('i686' 'x86_64') | |
url="https://www.gnu.org/software/gdbm/gdbm.html" | |
license=('GPL3') | |
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs") | |
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "make" "patch") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SRCS := $(wildcard *.c) | |
OBJS := $(patsubst %.c,%.o,$(SRCS)) | |
DOBJS := $(addprefix debug/,$(OBJS)) | |
POBJS := $(addprefix profile/,$(OBJS)) | |
CC = gcc | |
CFLAGS = -Wall -O3 | |
LDFLAGS = | |
LIBS = -lm -lgmp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstdint> | |
class digit_t { | |
friend std::istream& operator>>(std::istream&, digit_t&); | |
friend std::ostream& operator<<(std::ostream&, digit_t&); | |
private: | |
using value_type = uint_least64_t; | |
value_type data; | |
unsigned int check_digit; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!r6rs | |
;; 第25回シェル芸勉強会 Q6 -- UTF-16LE | |
;; http://qiita.com/nakataSyunsuke/items/339965853684dd11e755 | |
(import (rnrs) | |
(rnrs mutable-strings)) | |
(define (transcoded-from-hexstring-port in) | |
(define temporary (make-string 4)) | |
(define (read-cp) | |
(let* ((h (get-string-n! in temporary 2 2)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Makefile b/Makefile | |
index 0d31152..d09b1df 100644 | |
--- a/Makefile | |
+++ b/Makefile | |
@@ -6,10 +6,16 @@ | |
include Makefile.config | |
+UNAME = $(shell uname -a) | |
COBJ = scheme/base scheme/read scheme/write scheme/case-lambda scheme/char scheme/complex scheme/cxr scheme/eval scheme/file scheme/inexact scheme/lazy scheme/load scheme/process-context scheme/time scheme/cyclone/common scheme/cyclone/libraries scheme/cyclone/macros scheme/cyclone/transforms scheme/cyclone/ast scheme/cyclone/cps-optimizations scheme/cyclone/cgen scheme/cyclone/util scheme/cyclone/test scheme/cyclone/pretty-print scheme/cyclone/primitives srfi/1 srfi/2 srfi/9 srfi/18 srfi/27 srfi/69 srfi/106 srfi/111 srfi/113 srfi/117 srfi/128 srfi/132 srfi/133 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<class T> | |
class foo { | |
friend void T::qux(void); | |
private: | |
int baz; | |
public: | |
foo(void) : baz(1){} | |
}; | |
#include <iostream> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/contrib/10.roundtrip/emyg_atod.c b/contrib/10.roundtrip/emyg_atod.c | |
index f742e15..f69c50e 100644 | |
--- a/contrib/10.roundtrip/emyg_atod.c | |
+++ b/contrib/10.roundtrip/emyg_atod.c | |
@@ -44,6 +44,10 @@ | |
#include <ctype.h> // used by emyg_strtod | |
#include <math.h> // scalb() | |
+#ifdef __MINGW32__ | |
+#define scalb _scalb |