From 598e96a0cc073304a6ab49e4394ea9eb78868ed3 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Thu, 19 Oct 2017 14:41:51 +0100 Subject: [PATCH] Make amalgam work on windows PUBLISHED_FROM=92f43c7b0a705ff40c4aea07f2ee0627f8e0e4a1 --- tools/amalgam.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/amalgam.py b/tools/amalgam.py index 19291d19..3776d12a 100755 --- a/tools/amalgam.py +++ b/tools/amalgam.py @@ -99,9 +99,9 @@ def resolve(path, parent_name): else: p = os.path.join(args.include_path, path) if os.path.exists(p) and not args.norel: - p = os.path.realpath(p).replace('%s/' % os.getcwd(), '') + p = os.path.realpath(p).replace('%s%s' % (os.getcwd(), os.sep), '') # print >>sys.stderr, '%s -> %s (cwd %s)' % (path, p, os.getcwd()) - return p + return p.replace(os.sep, '/') def emit_line_directive(out, name, parent_name): print >>out, '''#ifdef %(prefix)s_MODULE_LINES @@ -148,6 +148,10 @@ if args.first: # emitting +if sys.platform == "win32": + import os, msvcrt + msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) + if args.public: print '#include "%s"' % (args.public)