From 2a7c79e3db3295ab15fddcfb8a97d85dda2842dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Tue, 12 Jan 2016 14:07:46 +0100 Subject: [PATCH 1/2] Fix setup.py script: handle unset OPT config var. --- setup.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 24ce343..ee20b02 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,13 @@ from setuptools import setup, Extension import os -from distutils.sysconfig import get_config_vars +from distutils.sysconfig import get_config_var -(opt,) = get_config_vars('OPT') -os.environ['OPT'] = " ".join( - flag for flag in opt.split() if flag != '-Wstrict-prototypes' -) +opt = get_config_var('OPT') +if opt: + os.environ['OPT'] = " ".join( + flag for flag in opt.split() if flag != '-Wstrict-prototypes' + ) setup( # Name of this package @@ -44,4 +45,4 @@ 'serpent = serpent:main', ], } - ), +) From c8e9cb23222bae2f6809070d454199593de097ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Tue, 12 Jan 2016 14:39:17 +0100 Subject: [PATCH 2/2] Fix compilation with Visual Studio. --- bignum.h | 4 +++- compiler.h | 2 -- funcs.cpp | 2 -- tokenize.cpp | 5 +---- tokenize.h | 4 +--- util.h | 2 -- 6 files changed, 5 insertions(+), 14 deletions(-) diff --git a/bignum.h b/bignum.h index a58aa1c..6dc86aa 100644 --- a/bignum.h +++ b/bignum.h @@ -1,9 +1,11 @@ #ifndef ETHSERP_BIGNUM #define ETHSERP_BIGNUM +#include + const std::string nums = "0123456789"; -const std::string tt256 = +const std::string tt256 = "115792089237316195423570985008687907853269984665640564039457584007913129639936" ; diff --git a/compiler.h b/compiler.h index ef70ca6..9a9593b 100644 --- a/compiler.h +++ b/compiler.h @@ -1,8 +1,6 @@ #ifndef ETHSERP_COMPILER #define ETHSERP_COMPILER -#include -#include #include #include #include "util.h" diff --git a/funcs.cpp b/funcs.cpp index 7336755..8499081 100644 --- a/funcs.cpp +++ b/funcs.cpp @@ -1,5 +1,3 @@ -#include -#include #include #include "funcs.h" #include "bignum.h" diff --git a/tokenize.cpp b/tokenize.cpp index cab40d4..b18a60e 100644 --- a/tokenize.cpp +++ b/tokenize.cpp @@ -1,8 +1,7 @@ -#include -#include #include #include #include "util.h" +#include "tokenize.h" // These appear as independent tokens even if inside a stream of symbols const std::string atoms[] = { "#", "//", "(", ")", "[", "]", "{", "}" }; @@ -100,5 +99,3 @@ std::vector tokenize(std::string inp, Metadata metadata, bool lispMode) { } return out; } - - diff --git a/tokenize.h b/tokenize.h index 04a42f3..a3812d3 100644 --- a/tokenize.h +++ b/tokenize.h @@ -1,10 +1,8 @@ #ifndef ETHSERP_TOKENIZE #define ETHSERP_TOKENIZE -#include -#include #include -#include +#include #include "util.h" int chartype(char c); diff --git a/util.h b/util.h index 39b1e6e..35c448d 100644 --- a/util.h +++ b/util.h @@ -1,8 +1,6 @@ #ifndef ETHSERP_UTIL #define ETHSERP_UTIL -#include -#include #include #include #include