← Back to team overview

kicad-developers team mailing list archive

[patch] improved support for MS Visual Studio

 

Hi,

This patchset enables building KiCad in MS Visual Studio (version 2017,
not tested on earlier versions). It is largely based on patches &
library builds by Simon Richter (thanks a lot!), with some improvements:
- no MSVC-specific patches other than setting the compiler parameters.
- no need for require boost::context workarounds as libcontext now
supports MSVC through native Windows Fiber API.
- prebuilt environment [1], containing the right versions of libraries
and tools (CMake & CMake modules). The supplied libraries currently
support only debug x86_64 targets.

Some of you might ask why bother with MSVC support? Here's a bunch of
reasons:
- A debugger that really works. GDB under Windows offers,
euphemistically speaking, sub-optimal user experience (very slow, Ctrl-C
kills the debugger instead of stopping the application being debugged,
enormous size of debug symbols).
- Much faster builds. GCC is very fast under Unix systems, but under
Unix emulation (MINGW) all the speed disappears.
- MSVC runtime libraries are quite different from the GNU/OSX ones. This
has already led to discovery of some critical bugs (StrNumCmp()). In
general. Building and testing KiCad with a non-GCC/Clang compiler can
only improve the quality of our code.
- I'm hoping new developers will join us. After all, 90% of desktop
software is made for Windows, most of it is written in VS and proficient
developers don't like switching their IDEs too often.

Happy testing,
Tom

PS. Could someone of our website maintainers give some space to host the
archive [1] on kicad-pcb.org?
	
[1] https://cernbox.cern.ch/index.php/s/UaFwaznK4258kZC







>From 9ecdaf94012155771a4b110af325fc3ea3b5b5ab Mon Sep 17 00:00:00 2001
From: Simon Richter <Simon.Richter@xxxxxxxxxx>
Date: Mon, 27 Apr 2015 23:45:43 +0200
Subject: [PATCH 1/9] Define compiler flags for MSVC

Defines:
 - inhibit generation of #pragma comment(lib, ...) from boost
 - inhibit warnings about "unsafe" containers
 - inhibit warnings about "unsafe" C functions
 - inhibit warnings about "deprecated" POSIX functions
 - ask for macros from math.h
 - suppress min/max macros from windows.h

Flags:
 - suppress warnings about throw() not being fully supported in the compiler
 - suppress warnings about values being explicitly cast to bool
 - enable string pooling
 - enable unreferenced code removal
 - enable COMDAT folding
 - generate PDB debug information

In addition, remove one explicit define that is now covered by the compiler flags.
---
 CMakeLists.txt | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c170e76bd..2550338e3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -376,6 +376,26 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
 
 endif( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
 
+if( MSVC )
+    add_definitions( -DBOOST_ALL_NO_LIB -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES -DNOMINMAX )
+    # C4290: throw() is interpreted as declspec(nothrow)
+    set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4290" )
+    # C4800: non-bool is explicitly cast to bool, forcing value of 0 or 1
+    set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800" )
+    # /Zi: create PDB
+    set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi" )
+    # /GF: enable string pooling
+    set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GF" )
+    foreach( type EXE SHARED MODULE)
+        # /DEBUG: create PDB
+        set( CMAKE_${type}_LINKER_FLAGS "${CMAKE_${type}_LINKER_FLAGS} /DEBUG" )
+        # /OPT:REF: omit unreferenced code
+        set( CMAKE_${type}_LINKER_FLAGS_RELEASE "${CMAKE_${type}_LINKER_FLAGS_RELEASE} /OPT:REF" )
+        # /OPT:ICF: fold common data
+        set( CMAKE_${type}_LINKER_FLAGS_RELEASE "${CMAKE_${type}_LINKER_FLAGS_RELEASE} /OPT:ICF" )
+    endforeach()
+endif()
+
 if( USE_WX_OVERLAY OR APPLE )
     add_definitions( -DUSE_WX_OVERLAY )
 endif()
-- 
2.17.1

>From 4cac3ab49916c4f981cd8728c2757749e2423cbd Mon Sep 17 00:00:00 2001
From: Simon Richter <Simon.Richter@xxxxxxxxxx>
Date: Fri, 8 Dec 2017 11:38:18 +0100
Subject: [PATCH 2/9] Remove own copy of FindOpenSSL.cmake

---
 CMakeModules/FindOpenSSL.cmake | 342 ---------------------------------
 1 file changed, 342 deletions(-)
 delete mode 100644 CMakeModules/FindOpenSSL.cmake

diff --git a/CMakeModules/FindOpenSSL.cmake b/CMakeModules/FindOpenSSL.cmake
deleted file mode 100644
index de91787c1..000000000
--- a/CMakeModules/FindOpenSSL.cmake
+++ /dev/null
@@ -1,342 +0,0 @@
-#.rst:
-# FindOpenSSL
-# -----------
-#
-# Try to find the OpenSSL encryption library
-#
-# Once done this will define
-#
-# ::
-#
-#   OPENSSL_ROOT_DIR - Set this variable to the root installation of OpenSSL
-#
-#
-#
-# Read-Only variables:
-#
-# ::
-#
-#   OPENSSL_FOUND - system has the OpenSSL library
-#   OPENSSL_INCLUDE_DIR - the OpenSSL include directory
-#   OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
-#   OPENSSL_VERSION - This is set to $major.$minor.$revision$path (eg. 0.9.8s)
-
-#=============================================================================
-# Copyright 2006-2009 Kitware, Inc.
-# Copyright 2006 Alexander Neundorf <neundorf@xxxxxxx>
-# Copyright 2009-2011 Mathieu Malaterre <mathieu.malaterre@xxxxxxxxx>
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-if (UNIX)
-  find_package(PkgConfig QUIET)
-  pkg_check_modules(_OPENSSL QUIET openssl)
-endif ()
-
-if (WIN32)
-  # http://www.slproweb.com/products/Win32OpenSSL.html
-  set(_OPENSSL_ROOT_HINTS
-    ${OPENSSL_ROOT_DIR}
-    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]"
-    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]"
-    ENV OPENSSL_ROOT_DIR
-    )
-  file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles)
-  set(_OPENSSL_ROOT_PATHS
-    "${_programfiles}/OpenSSL"
-    "${_programfiles}/OpenSSL-Win32"
-    "${_programfiles}/OpenSSL-Win64"
-    "C:/OpenSSL/"
-    "C:/OpenSSL-Win32/"
-    "C:/OpenSSL-Win64/"
-    )
-  unset(_programfiles)
-else ()
-  set(_OPENSSL_ROOT_HINTS
-    ${OPENSSL_ROOT_DIR}
-    ENV OPENSSL_ROOT_DIR
-    )
-endif ()
-
-set(_OPENSSL_ROOT_HINTS_AND_PATHS
-    HINTS ${_OPENSSL_ROOT_HINTS}
-    PATHS ${_OPENSSL_ROOT_PATHS}
-    )
-
-find_path(OPENSSL_INCLUDE_DIR
-  NAMES
-    openssl/ssl.h
-    ${_OPENSSL_ROOT_HINTS_AND_PATHS}
-  HINTS
-    ${_OPENSSL_INCLUDEDIR}
-  PATH_SUFFIXES
-    include
-)
-
-if(WIN32 AND NOT CYGWIN)
-  if(MSVC)
-    # /MD and /MDd are the standard values - if someone wants to use
-    # others, the libnames have to change here too
-    # use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b
-    # TODO: handle /MT and static lib
-    # In Visual C++ naming convention each of these four kinds of Windows libraries has it's standard suffix:
-    #   * MD for dynamic-release
-    #   * MDd for dynamic-debug
-    #   * MT for static-release
-    #   * MTd for static-debug
-
-    # Implementation details:
-    # We are using the libraries located in the VC subdir instead of the parent directory eventhough :
-    # libeay32MD.lib is identical to ../libeay32.lib, and
-    # ssleay32MD.lib is identical to ../ssleay32.lib
-    find_library(LIB_EAY_DEBUG
-      NAMES
-        libeay32MDd
-        libeay32d
-        ${_OPENSSL_ROOT_HINTS_AND_PATHS}
-      PATH_SUFFIXES
-        "lib"
-        "VC"
-        "lib/VC"
-    )
-
-    find_library(LIB_EAY_RELEASE
-      NAMES
-        libeay32MD
-        libeay32
-        ${_OPENSSL_ROOT_HINTS_AND_PATHS}
-      PATH_SUFFIXES
-        "lib"
-        "VC"
-        "lib/VC"
-    )
-
-    find_library(SSL_EAY_DEBUG
-      NAMES
-        ssleay32MDd
-        ssleay32d
-        ${_OPENSSL_ROOT_HINTS_AND_PATHS}
-      PATH_SUFFIXES
-        "lib"
-        "VC"
-        "lib/VC"
-    )
-
-    find_library(SSL_EAY_RELEASE
-      NAMES
-        ssleay32MD
-        ssleay32
-        ssl
-        ${_OPENSSL_ROOT_HINTS_AND_PATHS}
-      PATH_SUFFIXES
-        "lib"
-        "VC"
-        "lib/VC"
-    )
-
-    set(LIB_EAY_LIBRARY_DEBUG "${LIB_EAY_DEBUG}")
-    set(LIB_EAY_LIBRARY_RELEASE "${LIB_EAY_RELEASE}")
-    set(SSL_EAY_LIBRARY_DEBUG "${SSL_EAY_DEBUG}")
-    set(SSL_EAY_LIBRARY_RELEASE "${SSL_EAY_RELEASE}")
-
-    include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
-    select_library_configurations(LIB_EAY)
-    select_library_configurations(SSL_EAY)
-
-    mark_as_advanced(LIB_EAY_LIBRARY_DEBUG LIB_EAY_LIBRARY_RELEASE
-                     SSL_EAY_LIBRARY_DEBUG SSL_EAY_LIBRARY_RELEASE)
-    set( OPENSSL_LIBRARIES ${SSL_EAY_LIBRARY} ${LIB_EAY_LIBRARY} )
-  elseif(MINGW)
-    message( STATUS "Searching for OpenSSL in MinGW." )
-    # same player, for MinGW
-    set(LIB_EAY_NAMES libeay32)
-    set(SSL_EAY_NAMES ssleay32)
-    list(APPEND LIB_EAY_NAMES crypto)
-    list(APPEND SSL_EAY_NAMES ssl)
-
-    find_library(LIB_EAY
-      NAMES
-        ${LIB_EAY_NAMES}
-      ${_OPENSSL_ROOT_HINTS_AND_PATHS}
-      PATH_SUFFIXES
-        "lib"
-        "lib/MinGW"
-      # Do not search system path.  Otherwise the DLL will be found rather than the link library.
-      NO_SYSTEM_ENVIRONMENT_PATH
-      NO_CMAKE_SYSTEM_PATH
-    )
-
-    find_library(SSL_EAY
-      NAMES
-        ${SSL_EAY_NAMES}
-      ${_OPENSSL_ROOT_HINTS_AND_PATHS}
-      PATH_SUFFIXES
-        "lib"
-        "lib/MinGW"
-      # Do not search system path.  Otherwise the DLL will be found rather than the link library.
-      NO_SYSTEM_ENVIRONMENT_PATH
-      NO_CMAKE_SYSTEM_PATH
-    )
-
-    mark_as_advanced(SSL_EAY LIB_EAY)
-    set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
-    unset(LIB_EAY_NAMES)
-    unset(SSL_EAY_NAMES)
-  else()
-    # Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues:
-    find_library(LIB_EAY
-      NAMES
-        libeay32
-      ${_OPENSSL_ROOT_HINTS_AND_PATHS}
-      HINTS
-        ${_OPENSSL_LIBDIR}
-      PATH_SUFFIXES
-        lib
-    )
-
-    find_library(SSL_EAY
-      NAMES
-        ssleay32
-      ${_OPENSSL_ROOT_HINTS_AND_PATHS}
-      HINTS
-        ${_OPENSSL_LIBDIR}
-      PATH_SUFFIXES
-        lib
-    )
-
-    mark_as_advanced(SSL_EAY LIB_EAY)
-    set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
-  endif()
-else()
-
-  find_library(OPENSSL_SSL_LIBRARY
-    NAMES
-      ssl
-      ssleay32
-      ssleay32MD
-    ${_OPENSSL_ROOT_HINTS_AND_PATHS}
-    HINTS
-      ${_OPENSSL_LIBDIR}
-    PATH_SUFFIXES
-      lib
-  )
-
-  find_library(OPENSSL_CRYPTO_LIBRARY
-    NAMES
-      crypto
-    ${_OPENSSL_ROOT_HINTS_AND_PATHS}
-    HINTS
-      ${_OPENSSL_LIBDIR}
-    PATH_SUFFIXES
-      lib
-  )
-
-  mark_as_advanced(OPENSSL_CRYPTO_LIBRARY OPENSSL_SSL_LIBRARY)
-
-  # compat defines
-  set(OPENSSL_SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY})
-  set(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
-
-  set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
-
-endif()
-
-function(from_hex HEX DEC)
-  string(TOUPPER "${HEX}" HEX)
-  set(_res 0)
-  string(LENGTH "${HEX}" _strlen)
-
-  while (_strlen GREATER 0)
-    math(EXPR _res "${_res} * 16")
-    string(SUBSTRING "${HEX}" 0 1 NIBBLE)
-    string(SUBSTRING "${HEX}" 1 -1 HEX)
-    if (NIBBLE STREQUAL "A")
-      math(EXPR _res "${_res} + 10")
-    elseif (NIBBLE STREQUAL "B")
-      math(EXPR _res "${_res} + 11")
-    elseif (NIBBLE STREQUAL "C")
-      math(EXPR _res "${_res} + 12")
-    elseif (NIBBLE STREQUAL "D")
-      math(EXPR _res "${_res} + 13")
-    elseif (NIBBLE STREQUAL "E")
-      math(EXPR _res "${_res} + 14")
-    elseif (NIBBLE STREQUAL "F")
-      math(EXPR _res "${_res} + 15")
-    else()
-      math(EXPR _res "${_res} + ${NIBBLE}")
-    endif()
-
-    string(LENGTH "${HEX}" _strlen)
-  endwhile()
-
-  set(${DEC} ${_res} PARENT_SCOPE)
-endfunction()
-
-if (OPENSSL_INCLUDE_DIR)
-  if (_OPENSSL_VERSION)
-    set(OPENSSL_VERSION "${_OPENSSL_VERSION}")
-  elseif(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h")
-    file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str
-         REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*")
-
-    # The version number is encoded as 0xMNNFFPPS: major minor fix patch status
-    # The status gives if this is a developer or prerelease and is ignored here.
-    # Major, minor, and fix directly translate into the version numbers shown in
-    # the string. The patch field translates to the single character suffix that
-    # indicates the bug fix state, which 00 -> nothing, 01 -> a, 02 -> b and so
-    # on.
-
-    message(STATUS "OPENSSL_VERSION_STR=${openssl_version_str}")
-
-    string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F]).*$"
-           "\\1;\\2;\\3;\\4;\\5" OPENSSL_VERSION_LIST "${openssl_version_str}")
-    list(GET OPENSSL_VERSION_LIST 0 OPENSSL_VERSION_MAJOR)
-    list(GET OPENSSL_VERSION_LIST 1 OPENSSL_VERSION_MINOR)
-    from_hex("${OPENSSL_VERSION_MINOR}" OPENSSL_VERSION_MINOR)
-    list(GET OPENSSL_VERSION_LIST 2 OPENSSL_VERSION_FIX)
-    from_hex("${OPENSSL_VERSION_FIX}" OPENSSL_VERSION_FIX)
-    list(GET OPENSSL_VERSION_LIST 3 OPENSSL_VERSION_PATCH)
-
-    if (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
-      from_hex("${OPENSSL_VERSION_PATCH}" _tmp)
-      # 96 is the ASCII code of 'a' minus 1
-      math(EXPR OPENSSL_VERSION_PATCH_ASCII "${_tmp} + 96")
-      unset(_tmp)
-      # Once anyone knows how OpenSSL would call the patch versions beyond 'z'
-      # this should be updated to handle that, too. This has not happened yet
-      # so it is simply ignored here for now.
-      string(ASCII "${OPENSSL_VERSION_PATCH_ASCII}" OPENSSL_VERSION_PATCH_STRING)
-    endif ()
-
-    set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}")
-  endif ()
-endif ()
-
-include(FindPackageHandleStandardArgs)
-
-if (OPENSSL_VERSION)
-  find_package_handle_standard_args(OpenSSL
-    REQUIRED_VARS
-      OPENSSL_LIBRARIES
-      OPENSSL_INCLUDE_DIR
-    VERSION_VAR
-      OPENSSL_VERSION
-    FAIL_MESSAGE
-      "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
-  )
-else ()
-  find_package_handle_standard_args(OpenSSL "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
-    OPENSSL_LIBRARIES
-    OPENSSL_INCLUDE_DIR
-  )
-endif ()
-
-mark_as_advanced(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)
-- 
2.17.1

>From 3ecc4c30b76e97b8dc0d9f6d3d17fbce2d3991bf Mon Sep 17 00:00:00 2001
From: Simon Richter <Simon.Richter@xxxxxxxxxx>
Date: Fri, 27 Jul 2018 13:54:51 +0200
Subject: [PATCH 3/9] MSVC support for external includes

---
 CMakeLists.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2550338e3..a0ac14037 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -377,6 +377,9 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
 endif( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
 
 if( MSVC )
+    set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "/external:I ")
+    string( APPEND CMAKE_CXX_FLAGS " /experimental:external /external:W0" )
+
     add_definitions( -DBOOST_ALL_NO_LIB -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES -DNOMINMAX )
     # C4290: throw() is interpreted as declspec(nothrow)
     set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4290" )
-- 
2.17.1

>From dce433f38352fa27fe539295326812f8c5703b52 Mon Sep 17 00:00:00 2001
From: Simon Richter <Simon.Richter@xxxxxxxxxx>
Date: Wed, 31 Oct 2018 21:32:41 +0100
Subject: [PATCH 4/9] Work around missing min/max in Windows headers

Windows headers assume min/max to be macros, but we set NOMINMAX to hide
the macro definitions. This pulls in an alternative implementation.
---
 common/gal/cairo/cairo_print.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/common/gal/cairo/cairo_print.cpp b/common/gal/cairo/cairo_print.cpp
index a14b4c122..4c7bdd057 100644
--- a/common/gal/cairo/cairo_print.cpp
+++ b/common/gal/cairo/cairo_print.cpp
@@ -25,6 +25,12 @@
 #include <wx/dcmemory.h>
 #include <wx/dcprint.h>
 
+#ifdef NOMINMAX         /* workaround for gdiplus.h */
+#include <algorithm>
+using std::min;
+using std::max;
+#endif
+
 #ifdef __WXMSW__
 #include <windows.h>
 #include <gdiplus.h>
-- 
2.17.1

>From 69e4970f243c311d61607ed63b5a2d53a1415f0a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomasz=20W=C5=82ostowski?= <tomasz.wlostowski@xxxxxxx>
Date: Wed, 6 Mar 2019 17:08:07 +0100
Subject: [PATCH 5/9] msvc: enable parallel builds, remove unused compiler
 parameters

---
 CMakeLists.txt | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a0ac14037..8f811d7f9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -378,11 +378,10 @@ endif( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
 
 if( MSVC )
     set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "/external:I ")
-    string( APPEND CMAKE_CXX_FLAGS " /experimental:external /external:W0" )
 
     add_definitions( -DBOOST_ALL_NO_LIB -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES -DNOMINMAX )
     # C4290: throw() is interpreted as declspec(nothrow)
-    set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4290" )
+    set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4290 /MP" )
     # C4800: non-bool is explicitly cast to bool, forcing value of 0 or 1
     set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800" )
     # /Zi: create PDB
-- 
2.17.1

>From 908034eb6f385e96f76ec1069c6b1cd46527a6ac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomasz=20W=C5=82ostowski?= <tomasz.wlostowski@xxxxxxx>
Date: Wed, 6 Mar 2019 17:27:59 +0100
Subject: [PATCH 6/9] eeschema: use wxStrings instead of strncasecmp in ngspice
 code

---
 eeschema/sim/ngspice.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/eeschema/sim/ngspice.cpp b/eeschema/sim/ngspice.cpp
index 31885c2a6..c10a375b1 100644
--- a/eeschema/sim/ngspice.cpp
+++ b/eeschema/sim/ngspice.cpp
@@ -464,12 +464,13 @@ int NGSPICE::cbSendChar( char* what, int id, void* user )
 
     if( sim->m_reporter )
     {
+        wxString msg( what );
+
         // strip stdout/stderr from the line
-        if( ( strncasecmp( what, "stdout ", 7 ) == 0 )
-                || ( strncasecmp( what, "stderr ", 7 ) == 0 ) )
-            what += 7;
+        if( msg.StartsWith( wxT( "stdout " ) ) || msg.StartsWith( wxT( "stderr " ) ) )
+            msg = msg.Mid(7);
 
-        sim->m_reporter->Report( what );
+        sim->m_reporter->Report( msg );
     }
 
     return 0;
-- 
2.17.1

>From 7471bb0643bdc11cada49455552280a75ef22684 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomasz=20W=C5=82ostowski?= <tomasz.wlostowski@xxxxxxx>
Date: Wed, 6 Mar 2019 17:28:27 +0100
Subject: [PATCH 7/9] LIB_TREE_ITEM: if derived classes are exported, so should
 be the base class

---
 include/lib_tree_item.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/lib_tree_item.h b/include/lib_tree_item.h
index 5ad5ef4bd..28f69b7c0 100644
--- a/include/lib_tree_item.h
+++ b/include/lib_tree_item.h
@@ -27,7 +27,7 @@
 
 #include <base_struct.h>
 #include <lib_id.h>
-
+#include <import_export.h>
 
 /**
  * A mix-in to provide polymorphism between items stored in libraries (symbols, aliases
@@ -36,7 +36,7 @@
  * It is used primarily to drive the component tree for library browsing and editing.
  */
 
-class LIB_TREE_ITEM
+class APIEXPORT LIB_TREE_ITEM
 {
 public:
     virtual LIB_ID GetLibId() const = 0;
-- 
2.17.1

>From 7eef08fac52c21a0c83adf325c207eebc91a2297 Mon Sep 17 00:00:00 2001
From: Tomasz Wlostowski <tomasz.wlostowski@xxxxxxx>
Date: Wed, 6 Mar 2019 14:01:40 +0100
Subject: [PATCH 8/9] pcbnew: can't return a copy of ptr_vector if items are
 polymorphic and have no clone() methods. Work it around.

---
 pcbnew/pcb_edit_frame.h  |  3 ++-
 pcbnew/pcbnew_config.cpp | 12 ++++++------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/pcbnew/pcb_edit_frame.h b/pcbnew/pcb_edit_frame.h
index e5a04898f..669b97119 100644
--- a/pcbnew/pcb_edit_frame.h
+++ b/pcbnew/pcb_edit_frame.h
@@ -97,6 +97,7 @@ protected:
     DRC* m_drc;                                 ///< the DRC controller, see drc.cpp
 
     PARAM_CFG_ARRAY   m_configParams;         ///< List of Pcbnew configuration settings.
+    PARAM_CFG_ARRAY   m_projectFileParams;
 
     wxString          m_lastNetListRead;        ///< Last net list read with relative path.
 
@@ -439,7 +440,7 @@ public:
      * @return PARAM_CFG_ARRAY - it is only good until SetBoard() is called, so
      *   don't keep it around past that event.
      */
-    PARAM_CFG_ARRAY GetProjectFileParameters();
+    PARAM_CFG_ARRAY& GetProjectFileParameters();
 
     /**
      * Function SaveProjectSettings
diff --git a/pcbnew/pcbnew_config.cpp b/pcbnew/pcbnew_config.cpp
index b6025a526..4055b2c7b 100644
--- a/pcbnew/pcbnew_config.cpp
+++ b/pcbnew/pcbnew_config.cpp
@@ -147,21 +147,21 @@ void PCB_EDIT_FRAME::SaveProjectSettings( bool aAskForSave )
 }
 
 
-PARAM_CFG_ARRAY PCB_EDIT_FRAME::GetProjectFileParameters()
+PARAM_CFG_ARRAY& PCB_EDIT_FRAME::GetProjectFileParameters()
 {
-    PARAM_CFG_ARRAY pca;
+    m_projectFileParams.clear();
 
     // This one cannot be cached because some settings are going to/from the BOARD,
     // so pointers into that cannot be saved for long.
 
-    pca.push_back( new PARAM_CFG_FILENAME( wxT( "PageLayoutDescrFile" ),
+    m_projectFileParams.push_back( new PARAM_CFG_FILENAME( wxT( "PageLayoutDescrFile" ),
                                           &BASE_SCREEN::m_PageLayoutDescrFileName ) );
 
-    pca.push_back( new PARAM_CFG_FILENAME( wxT( "LastNetListRead" ), &m_lastNetListRead ) );
+    m_projectFileParams.push_back( new PARAM_CFG_FILENAME( wxT( "LastNetListRead" ), &m_lastNetListRead ) );
 
-    GetBoard()->GetDesignSettings().AppendConfigs( GetBoard(), &pca );
+    GetBoard()->GetDesignSettings().AppendConfigs( GetBoard(), &m_projectFileParams);
 
-    return pca;
+    return m_projectFileParams;
 }
 
 
-- 
2.17.1

From 79b9c51f44119abf98849ca63dbf7abff7cc43f4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomasz=20W=C5=82ostowski?= <tomasz.wlostowski@xxxxxxx>
Date: Wed, 6 Mar 2019 17:28:36 +0100
Subject: [PATCH 9/9] libcontext: use native Windows Fiber API for coroutines
 on MSVC

---
 common/system/libcontext.cpp | 2606 +++++++++++++++++-----------------
 include/system/libcontext.h  |   20 +-
 include/tool/coroutine.h     |    8 +-
 3 files changed, 1359 insertions(+), 1275 deletions(-)

diff --git a/common/system/libcontext.cpp b/common/system/libcontext.cpp
index f6f83ceae..8d5ee6041 100644
--- a/common/system/libcontext.cpp
+++ b/common/system/libcontext.cpp
@@ -1,1270 +1,1336 @@
-/*
-
-    auto-generated file, do not modify!
-    libcontext - a slightly more portable version of boost::context
-    Copyright Martin Husemann 2013.
-    Copyright Oliver Kowalke 2009.
-    Copyright Sergue E. Leontiev 2013
-    Copyright Thomas Sailer 2013.
-    Minor modifications by Tomasz Wlostowski 2016.
-
- Distributed under the Boost Software License, Version 1.0.
-      (See accompanying file LICENSE.BOOSTv1_0.txt or copy at
-            http://www.boost.org/LICENSE_1_0.txt)
-
-*/
-#include <system/libcontext.h>
-
-#if defined(LIBCONTEXT_PLATFORM_windows_i386) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".p2align 4,,15\n"
-".globl	_jump_fcontext\n"
-".def	_jump_fcontext;	.scl	2;	.type	32;	.endef\n"
-"_jump_fcontext:\n"
-"    mov    0x10(%esp),%ecx\n"
-"    push   %ebp\n"
-"    push   %ebx\n"
-"    push   %esi\n"
-"    push   %edi\n"
-"    mov    %fs:0x18,%edx\n"
-"    mov    (%edx),%eax\n"
-"    push   %eax\n"
-"    mov    0x4(%edx),%eax\n"
-"    push   %eax\n"
-"    mov    0x8(%edx),%eax\n"
-"    push   %eax\n"
-"    mov    0xe0c(%edx),%eax\n"
-"    push   %eax\n"
-"    mov    0x10(%edx),%eax\n"
-"    push   %eax\n"
-"    lea    -0x8(%esp),%esp\n"
-"    test   %ecx,%ecx\n"
-"    je     nxt1\n"
-"    stmxcsr (%esp)\n"
-"    fnstcw 0x4(%esp)\n"
-"nxt1:\n"
-"    mov    0x30(%esp),%eax\n"
-"    mov    %esp,(%eax)\n"
-"    mov    0x34(%esp),%edx\n"
-"    mov    0x38(%esp),%eax\n"
-"    mov    %edx,%esp\n"
-"    test   %ecx,%ecx\n"
-"    je     nxt2\n"
-"    ldmxcsr (%esp)\n"
-"    fldcw  0x4(%esp)\n"
-"nxt2:\n"
-"    lea    0x8(%esp),%esp\n"
-"    mov    %fs:0x18,%edx\n"
-"    pop    %ecx\n"
-"    mov    %ecx,0x10(%edx)\n"
-"    pop    %ecx\n"
-"    mov    %ecx,0xe0c(%edx)\n"
-"    pop    %ecx\n"
-"    mov    %ecx,0x8(%edx)\n"
-"    pop    %ecx\n"
-"    mov    %ecx,0x4(%edx)\n"
-"    pop    %ecx\n"
-"    mov    %ecx,(%edx)\n"
-"    pop    %edi\n"
-"    pop    %esi\n"
-"    pop    %ebx\n"
-"    pop    %ebp\n"
-"    pop    %edx\n"
-"    mov    %eax,0x4(%esp)\n"
-"    jmp    *%edx\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_windows_i386) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".p2align 4,,15\n"
-".globl	_make_fcontext\n"
-".def	_make_fcontext;	.scl	2;	.type	32;	.endef\n"
-"_make_fcontext:\n"
-"mov    0x4(%esp),%eax\n"
-"lea    -0x8(%eax),%eax\n"
-"and    $0xfffffff0,%eax\n"
-"lea    -0x3c(%eax),%eax\n"
-"mov    0x4(%esp),%ecx\n"
-"mov    %ecx,0x14(%eax)\n"
-"mov    0x8(%esp),%edx\n"
-"neg    %edx\n"
-"lea    (%ecx,%edx,1),%ecx\n"
-"mov    %ecx,0x10(%eax)\n"
-"mov    %ecx,0xc(%eax)\n"
-"mov    0xc(%esp),%ecx\n"
-"mov    %ecx,0x2c(%eax)\n"
-"stmxcsr (%eax)\n"
-"fnstcw 0x4(%eax)\n"
-"mov    $finish,%ecx\n"
-"mov    %ecx,0x30(%eax)\n"
-"mov    %fs:0x0,%ecx\n"
-"walk:\n"
-"mov    (%ecx),%edx\n"
-"inc    %edx\n"
-"je     found\n"
-"dec    %edx\n"
-"xchg   %edx,%ecx\n"
-"jmp    walk\n"
-"found:\n"
-"mov    0x4(%ecx),%ecx\n"
-"mov    %ecx,0x3c(%eax)\n"
-"mov    $0xffffffff,%ecx\n"
-"mov    %ecx,0x38(%eax)\n"
-"lea    0x38(%eax),%ecx\n"
-"mov    %ecx,0x18(%eax)\n"
-"ret\n"
-"finish:\n"
-"xor    %eax,%eax\n"
-"mov    %eax,(%esp)\n"
-"call   _exit\n"
-"hlt\n"
-".def	__exit;	.scl	2;	.type	32;	.endef  \n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_windows_x86_64) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".p2align 4,,15\n"
-".globl	jump_fcontext\n"
-".def	jump_fcontext;	.scl	2;	.type	32;	.endef\n"
-".seh_proc	jump_fcontext\n"
-"jump_fcontext:\n"
-".seh_endprologue\n"
-"	push   %rbp\n"
-"	push   %rbx\n"
-"	push   %rsi\n"
-"	push   %rdi\n"
-"	push   %r15\n"
-"	push   %r14\n"
-"	push   %r13\n"
-"	push   %r12\n"
-"	mov    %gs:0x30,%r10\n"
-"	mov    0x8(%r10),%rax\n"
-"	push   %rax\n"
-"	mov    0x10(%r10),%rax\n"
-"	push   %rax\n"
-"	mov    0x1478(%r10),%rax\n"
-"	push   %rax\n"
-"	mov    0x18(%r10),%rax\n"
-"	push   %rax\n"
-"	lea    -0xa8(%rsp),%rsp\n"
-"	test   %r9,%r9\n"
-"	je     nxt1\n"
-"	stmxcsr 0xa0(%rsp)\n"
-"	fnstcw 0xa4(%rsp)\n"
-"	movaps %xmm6,(%rsp)\n"
-"	movaps %xmm7,0x10(%rsp)\n"
-"	movaps %xmm8,0x20(%rsp)\n"
-"	movaps %xmm9,0x30(%rsp)\n"
-"	movaps %xmm10,0x40(%rsp)\n"
-"	movaps %xmm11,0x50(%rsp)\n"
-"	movaps %xmm12,0x60(%rsp)\n"
-"	movaps %xmm13,0x70(%rsp)\n"
-"	movaps %xmm14,0x80(%rsp)\n"
-"	movaps %xmm15,0x90(%rsp)\n"
-"nxt1:\n"
-"	xor    %r10,%r10\n"
-"	push   %r10\n"
-"	mov    %rsp,(%rcx)\n"
-"	mov    %rdx,%rsp\n"
-"	pop    %r10\n"
-"	test   %r9,%r9\n"
-"	je     nxt2\n"
-"	ldmxcsr 0xa0(%rsp)\n"
-"	fldcw  0xa4(%rsp)\n"
-"	movaps (%rsp),%xmm6\n"
-"	movaps 0x10(%rsp),%xmm7\n"
-"	movaps 0x20(%rsp),%xmm8\n"
-"	movaps 0x30(%rsp),%xmm9\n"
-"	movaps 0x40(%rsp),%xmm10\n"
-"	movaps 0x50(%rsp),%xmm11\n"
-"	movaps 0x60(%rsp),%xmm12\n"
-"	movaps 0x70(%rsp),%xmm13\n"
-"	movaps 0x80(%rsp),%xmm14\n"
-"	movaps 0x90(%rsp),%xmm15\n"
-"nxt2:\n"
-"	mov    $0xa8,%rcx\n"
-"    test   %r10,%r10\n"
-"    je     nxt3\n"
-"    add    $0x8,%rcx\n"
-"nxt3:\n"
-"	lea    (%rsp,%rcx,1),%rsp\n"
-"	mov    %gs:0x30,%r10\n"
-"	pop    %rax\n"
-"	mov    %rax,0x18(%r10)\n"
-"	pop    %rax\n"
-"	mov    %rax,0x1478(%r10)\n"
-"	pop    %rax\n"
-"	mov    %rax,0x10(%r10)\n"
-"	pop    %rax\n"
-"	mov    %rax,0x8(%r10)\n"
-"	pop    %r12\n"
-"	pop    %r13\n"
-"	pop    %r14\n"
-"	pop    %r15\n"
-"	pop    %rdi\n"
-"	pop    %rsi\n"
-"	pop    %rbx\n"
-"	pop    %rbp\n"
-"	pop    %r10\n"
-"	mov    %r8,%rax\n"
-"	mov    %r8,%rcx\n"
-"	jmpq   *%r10\n"
-".seh_endproc\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_windows_x86_64) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".p2align 4,,15\n"
-".globl	make_fcontext\n"
-".def	make_fcontext;	.scl	2;	.type	32;	.endef\n"
-".seh_proc	make_fcontext\n"
-"make_fcontext:\n"
-".seh_endprologue\n"
-"mov    %rcx,%rax\n"
-"sub    $0x28,%rax\n"
-"and    $0xfffffffffffffff0,%rax\n"
-"sub    $0x128,%rax\n"
-"mov    %r8,0x118(%rax)\n"
-"mov    %rcx,0xd0(%rax)\n"
-"neg    %rdx\n"
-"lea    (%rcx,%rdx,1),%rcx\n"
-"mov    %rcx,0xc8(%rax)\n"
-"mov    %rcx,0xc0(%rax)\n"
-"stmxcsr 0xa8(%rax)\n"
-"fnstcw 0xac(%rax)\n"
-"leaq  finish(%rip), %rcx\n"
-"mov    %rcx,0x120(%rax)\n"
-"mov    $0x1,%rcx\n"
-"mov    %rcx,(%rax)\n"
-"retq\n"
-"finish:\n"
-"xor    %rcx,%rcx\n"
-"callq  0x63\n"
-"hlt\n"
-"   .seh_endproc\n"
-".def	_exit;	.scl	2;	.type	32;	.endef  \n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_linux_i386) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".globl jump_fcontext\n"
-".align 2\n"
-".type jump_fcontext,@function\n"
-"jump_fcontext:\n"
-"    movl  0x10(%esp), %ecx\n"
-"    pushl  %ebp  \n"
-"    pushl  %ebx  \n"
-"    pushl  %esi  \n"
-"    pushl  %edi  \n"
-"    leal  -0x8(%esp), %esp\n"
-"    test  %ecx, %ecx\n"
-"    je  1f\n"
-"    stmxcsr  (%esp)\n"
-"    fnstcw  0x4(%esp)\n"
-"1:\n"
-"    movl  0x1c(%esp), %eax\n"
-"    movl  %esp, (%eax)\n"
-"    movl  0x20(%esp), %edx\n"
-"    movl  0x24(%esp), %eax\n"
-"    movl  %edx, %esp\n"
-"    test  %ecx, %ecx\n"
-"    je  2f\n"
-"    ldmxcsr  (%esp)\n"
-"    fldcw  0x4(%esp)\n"
-"2:\n"
-"    leal  0x8(%esp), %esp\n"
-"    popl  %edi  \n"
-"    popl  %esi  \n"
-"    popl  %ebx  \n"
-"    popl  %ebp  \n"
-"    popl  %edx\n"
-"    movl  %eax, 0x4(%esp)\n"
-"    jmp  *%edx\n"
-".size jump_fcontext,.-jump_fcontext\n"
-".section .note.GNU-stack,\"\",%progbits\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_linux_i386) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".globl make_fcontext\n"
-".align 2\n"
-".type make_fcontext,@function\n"
-"make_fcontext:\n"
-"    movl  0x4(%esp), %eax\n"
-"    leal  -0x8(%eax), %eax\n"
-"    andl  $-16, %eax\n"
-"    leal  -0x20(%eax), %eax\n"
-"    movl  0xc(%esp), %edx\n"
-"    movl  %edx, 0x18(%eax)\n"
-"    stmxcsr  (%eax)\n"
-"    fnstcw  0x4(%eax)\n"
-"    call  1f\n"
-"1:  popl  %ecx\n"
-"    addl  $finish-1b, %ecx\n"
-"    movl  %ecx, 0x1c(%eax)\n"
-"    ret \n"
-"finish:\n"
-"    call  2f\n"
-"2:  popl  %ebx\n"
-"    addl  $_GLOBAL_OFFSET_TABLE_+[.-2b], %ebx\n"
-"    xorl  %eax, %eax\n"
-"    movl  %eax, (%esp)\n"
-"    call  _exit@PLT\n"
-"    hlt\n"
-".size make_fcontext,.-make_fcontext\n"
-".section .note.GNU-stack,\"\",%progbits\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_linux_x86_64) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".globl jump_fcontext\n"
-".type jump_fcontext,@function\n"
-".align 16\n"
-"jump_fcontext:\n"
-"    pushq  %rbp  \n"
-"    pushq  %rbx  \n"
-"    pushq  %r15  \n"
-"    pushq  %r14  \n"
-"    pushq  %r13  \n"
-"    pushq  %r12  \n"
-"    leaq  -0x8(%rsp), %rsp\n"
-"    cmp  $0, %rcx\n"
-"    je  1f\n"
-"    stmxcsr  (%rsp)\n"
-"    fnstcw   0x4(%rsp)\n"
-"1:\n"
-"    movq  %rsp, (%rdi)\n"
-"    movq  %rsi, %rsp\n"
-"    cmp  $0, %rcx\n"
-"    je  2f\n"
-"    ldmxcsr  (%rsp)\n"
-"    fldcw  0x4(%rsp)\n"
-"2:\n"
-"    leaq  0x8(%rsp), %rsp\n"
-"    popq  %r12  \n"
-"    popq  %r13  \n"
-"    popq  %r14  \n"
-"    popq  %r15  \n"
-"    popq  %rbx  \n"
-"    popq  %rbp  \n"
-"    popq  %r8\n"
-"    movq  %rdx, %rax\n"
-"    movq  %rdx, %rdi\n"
-"    jmp  *%r8\n"
-".size jump_fcontext,.-jump_fcontext\n"
-".section .note.GNU-stack,\"\",%progbits\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_linux_x86_64) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".globl make_fcontext\n"
-".type make_fcontext,@function\n"
-".align 16\n"
-"make_fcontext:\n"
-"    movq  %rdi, %rax\n"
-"    andq  $-16, %rax\n"
-"    leaq  -0x48(%rax), %rax\n"
-"    movq  %rdx, 0x38(%rax)\n"
-"    stmxcsr  (%rax)\n"
-"    fnstcw   0x4(%rax)\n"
-"    leaq  finish(%rip), %rcx\n"
-"    movq  %rcx, 0x40(%rax)\n"
-"    ret \n"
-"finish:\n"
-"    xorq  %rdi, %rdi\n"
-"    call  _exit@PLT\n"
-"    hlt\n"
-".size make_fcontext,.-make_fcontext\n"
-".section .note.GNU-stack,\"\",%progbits\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_apple_x86_64) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".globl _jump_fcontext\n"
-".align 8\n"
-"_jump_fcontext:\n"
-"    pushq  %rbp  \n"
-"    pushq  %rbx  \n"
-"    pushq  %r15  \n"
-"    pushq  %r14  \n"
-"    pushq  %r13  \n"
-"    pushq  %r12  \n"
-"    leaq  -0x8(%rsp), %rsp\n"
-"    cmp  $0, %rcx\n"
-"    je  1f\n"
-"    stmxcsr  (%rsp)\n"
-"    fnstcw   0x4(%rsp)\n"
-"1:\n"
-"    movq  %rsp, (%rdi)\n"
-"    movq  %rsi, %rsp\n"
-"    cmp  $0, %rcx\n"
-"    je  2f\n"
-"    ldmxcsr  (%rsp)\n"
-"    fldcw  0x4(%rsp)\n"
-"2:\n"
-"    leaq  0x8(%rsp), %rsp\n"
-"    popq  %r12  \n"
-"    popq  %r13  \n"
-"    popq  %r14  \n"
-"    popq  %r15  \n"
-"    popq  %rbx  \n"
-"    popq  %rbp  \n"
-"    popq  %r8\n"
-"    movq  %rdx, %rax\n"
-"    movq  %rdx, %rdi\n"
-"    jmp  *%r8\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_apple_x86_64) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".globl _make_fcontext\n"
-".align 8\n"
-"_make_fcontext:\n"
-"    movq  %rdi, %rax\n"
-"    movabs  $-16,           %r8\n"
-"    andq    %r8,            %rax\n"
-"    leaq  -0x48(%rax), %rax\n"
-"    movq  %rdx, 0x38(%rax)\n"
-"    stmxcsr  (%rax)\n"
-"    fnstcw   0x4(%rax)\n"
-"    leaq  finish(%rip), %rcx\n"
-"    movq  %rcx, 0x40(%rax)\n"
-"    ret \n"
-"finish:\n"
-"    xorq  %rdi, %rdi\n"
-"    call  __exit\n"
-"    hlt\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_apple_i386) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".globl _jump_fcontext\n"
-".align 2\n"
-"_jump_fcontext:\n"
-"    movl  0x10(%esp), %ecx\n"
-"    pushl  %ebp  \n"
-"    pushl  %ebx  \n"
-"    pushl  %esi  \n"
-"    pushl  %edi  \n"
-"    leal  -0x8(%esp), %esp\n"
-"    test  %ecx, %ecx\n"
-"    je  1f\n"
-"    stmxcsr  (%esp)\n"
-"    fnstcw  0x4(%esp)\n"
-"1:\n"
-"    movl  0x1c(%esp), %eax\n"
-"    movl  %esp, (%eax)\n"
-"    movl  0x20(%esp), %edx\n"
-"    movl  0x24(%esp), %eax\n"
-"    movl  %edx, %esp\n"
-"    test  %ecx, %ecx\n"
-"    je  2f\n"
-"    ldmxcsr  (%esp)\n"
-"    fldcw  0x4(%esp)\n"
-"2:\n"
-"    leal  0x8(%esp), %esp\n"
-"    popl  %edi  \n"
-"    popl  %esi  \n"
-"    popl  %ebx  \n"
-"    popl  %ebp  \n"
-"    popl  %edx\n"
-"    movl  %eax, 0x4(%esp)\n"
-"    jmp  *%edx\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_apple_i386) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".globl _make_fcontext\n"
-".align 2\n"
-"_make_fcontext:\n"
-"    movl  0x4(%esp), %eax\n"
-"    leal  -0x8(%eax), %eax\n"
-"    andl  $-16, %eax\n"
-"    leal  -0x20(%eax), %eax\n"
-"    movl  0xc(%esp), %edx\n"
-"    movl  %edx, 0x18(%eax)\n"
-"    stmxcsr  (%eax)\n"
-"    fnstcw  0x4(%eax)\n"
-"    call  1f\n"
-"1:  popl  %ecx\n"
-"    addl  $finish-1b, %ecx\n"
-"    movl  %ecx, 0x1c(%eax)\n"
-"    ret \n"
-"finish:\n"
-"    xorl  %eax, %eax\n"
-"    movl  %eax, (%esp)\n"
-"    call  __exit\n"
-"    hlt\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_linux_arm32) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".globl jump_fcontext\n"
-".align 2\n"
-".type jump_fcontext,%function\n"
-"jump_fcontext:\n"
-"    @ save LR as PC\n"
-"    push {lr}\n"
-"    @ save V1-V8,LR\n"
-"    push {v1-v8,lr}\n"
-"    @ prepare stack for FPU\n"
-"    sub  sp, sp, #64\n"
-"    @ test if fpu env should be preserved\n"
-"    cmp  a4, #0\n"
-"    beq  1f\n"
-"    @ save S16-S31\n"
-"    vstmia  sp, {d8-d15}\n"
-"1:\n"
-"    @ store RSP (pointing to context-data) in A1\n"
-"    str  sp, [a1]\n"
-"    @ restore RSP (pointing to context-data) from A2\n"
-"    mov  sp, a2\n"
-"    @ test if fpu env should be preserved\n"
-"    cmp  a4, #0\n"
-"    beq  2f\n"
-"    @ restore S16-S31\n"
-"    vldmia  sp, {d8-d15}\n"
-"2:\n"
-"    @ prepare stack for FPU\n"
-"    add  sp, sp, #64\n"
-"    @ use third arg as return value after jump\n"
-"    @ and as first arg in context function\n"
-"    mov  a1, a3\n"
-"    @ restore v1-V8,LR,PC\n"
-"    pop {v1-v8,lr}\n"
-"    pop {pc}\n"
-".size jump_fcontext,.-jump_fcontext\n"
-"@ Mark that we don't need executable stack.\n"
-".section .note.GNU-stack,\"\",%progbits\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_linux_arm32) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".globl make_fcontext\n"
-".align 2\n"
-".type make_fcontext,%function\n"
-"make_fcontext:\n"
-"    @ shift address in A1 to lower 16 byte boundary\n"
-"    bic  a1, a1, #15\n"
-"    @ reserve space for context-data on context-stack\n"
-"    sub  a1, a1, #104\n"
-"    @ third arg of make_fcontext() == address of context-function\n"
-"    str  a3, [a1,#100]\n"
-"    @ compute abs address of label finish\n"
-"    adr  a2, finish\n"
-"    @ save address of finish as return-address for context-function\n"
-"    @ will be entered after context-function returns\n"
-"    str  a2, [a1,#96]\n"
-"    bx  lr @ return pointer to context-data\n"
-"finish:\n"
-"    @ exit code is zero\n"
-"    mov  a1, #0\n"
-"    @ exit application\n"
-"    bl  _exit@PLT\n"
-".size make_fcontext,.-make_fcontext\n"
-"@ Mark that we don't need executable stack.\n"
-".section .note.GNU-stack,\"\",%progbits\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_linux_arm64) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".cpu    generic+fp+simd\n"
-".text\n"
-".align  2\n"
-".global jump_fcontext\n"
-".type   jump_fcontext, %function\n"
-"jump_fcontext:\n"
-"    # prepare stack for GP + FPU\n"
-"    sub  sp, sp, #0xb0\n"
-"# Because gcc may save integer registers in fp registers across a\n"
-"# function call we cannot skip saving the fp registers.\n"
-"#\n"
-"# Do not reinstate this test unless you fully understand what you\n"
-"# are doing.\n"
-"#\n"
-"#    # test if fpu env should be preserved\n"
-"#    cmp  w3, #0\n"
-"#    b.eq  1f\n"
-"    # save d8 - d15\n"
-"    stp  d8,  d9,  [sp, #0x00]\n"
-"    stp  d10, d11, [sp, #0x10]\n"
-"    stp  d12, d13, [sp, #0x20]\n"
-"    stp  d14, d15, [sp, #0x30]\n"
-"1:\n"
-"    # save x19-x30\n"
-"    stp  x19, x20, [sp, #0x40]\n"
-"    stp  x21, x22, [sp, #0x50]\n"
-"    stp  x23, x24, [sp, #0x60]\n"
-"    stp  x25, x26, [sp, #0x70]\n"
-"    stp  x27, x28, [sp, #0x80]\n"
-"    stp  x29, x30, [sp, #0x90]\n"
-"    # save LR as PC\n"
-"    str  x30, [sp, #0xa0]\n"
-"    # store RSP (pointing to context-data) in first argument (x0).\n"
-"    # STR cannot have sp as a target register\n"
-"    mov  x4, sp\n"
-"    str  x4, [x0]\n"
-"    # restore RSP (pointing to context-data) from A2 (x1)\n"
-"    mov  sp, x1\n"
-"#    # test if fpu env should be preserved\n"
-"#    cmp  w3, #0\n"
-"#    b.eq  2f\n"
-"    # load d8 - d15\n"
-"    ldp  d8,  d9,  [sp, #0x00]\n"
-"    ldp  d10, d11, [sp, #0x10]\n"
-"    ldp  d12, d13, [sp, #0x20]\n"
-"    ldp  d14, d15, [sp, #0x30]\n"
-"2:\n"
-"    # load x19-x30\n"
-"    ldp  x19, x20, [sp, #0x40]\n"
-"    ldp  x21, x22, [sp, #0x50]\n"
-"    ldp  x23, x24, [sp, #0x60]\n"
-"    ldp  x25, x26, [sp, #0x70]\n"
-"    ldp  x27, x28, [sp, #0x80]\n"
-"    ldp  x29, x30, [sp, #0x90]\n"
-"    # use third arg as return value after jump\n"
-"    # and as first arg in context function\n"
-"    mov  x0, x2\n"
-"    # load pc\n"
-"    ldr  x4, [sp, #0xa0]\n"
-"    # restore stack from GP + FPU\n"
-"    add  sp, sp, #0xb0\n"
-"    ret x4\n"
-".size   jump_fcontext,.-jump_fcontext\n"
-"# Mark that we don't need executable stack.\n"
-".section .note.GNU-stack,\"\",%progbits\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_linux_arm64) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".cpu    generic+fp+simd\n"
-".text\n"
-".align  2\n"
-".global make_fcontext\n"
-".type   make_fcontext, %function\n"
-"make_fcontext:\n"
-"    # shift address in x0 (allocated stack) to lower 16 byte boundary\n"
-"    and x0, x0, ~0xF\n"
-"    # reserve space for context-data on context-stack\n"
-"    sub  x0, x0, #0xb0\n"
-"    # third arg of make_fcontext() == address of context-function\n"
-"    # store address as a PC to jump in\n"
-"    str  x2, [x0, #0xa0]\n"
-"    # save address of finish as return-address for context-function\n"
-"    # will be entered after context-function returns (LR register)\n"
-"    adr  x1, finish\n"
-"    str  x1, [x0, #0x98]\n"
-"    ret  x30 \n"
-"finish:\n"
-"    # exit code is zero\n"
-"    mov  x0, #0\n"
-"    # exit application\n"
-"    bl  _exit\n"
-".size   make_fcontext,.-make_fcontext\n"
-"# Mark that we don't need executable stack.\n"
-".section .note.GNU-stack,\"\",%progbits\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_linux_mips_n64) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".globl jump_fcontext\n"
-".align 2\n"
-".set noreorder\n"
-".type jump_fcontext,@function\n"
-".ent jump_fcontext\n"
-"jump_fcontext:\n"
-"    # reserve space on stack\n"
-"    daddiu $sp, $sp, -176\n"
-"    sd  $s0, 64($sp)  # save S0\n"
-"    sd  $s1, 72($sp)  # save S1\n"
-"    sd  $s2, 80($sp)  # save S2\n"
-"    sd  $s3, 88($sp)  # save S3\n"
-"    sd  $s4, 96($sp)  # save S4\n"
-"    sd  $s5, 104($sp) # save S5\n"
-"    sd  $s6, 112($sp) # save S6\n"
-"    sd  $s7, 120($sp) # save S7\n"
-"    sd  $fp, 128($sp) # save FP\n"
-"    sd  $ra, 144($sp) # save RA\n"
-"    sd  $ra, 152($sp) # save RA as PC\n"
-"    s.d  $f24, 0($sp)   # save F24\n"
-"    s.d  $f25, 8($sp)   # save F25\n"
-"    s.d  $f26, 16($sp)  # save F26\n"
-"    s.d  $f27, 24($sp)  # save F27\n"
-"    s.d  $f28, 32($sp)  # save F28\n"
-"    s.d  $f29, 40($sp)  # save F29\n"
-"    s.d  $f30, 48($sp)  # save F30\n"
-"    s.d  $f31, 56($sp)  # save F31\n"
-"    # store SP (pointing to old context-data) in pointer a0(first arg)\n"
-"    sd  $sp, 0($a0)\n"
-"    # get SP (pointing to new context-data) from a1 param\n"
-"    move  $sp, $a1\n"
-"    l.d  $f24, 0($sp)   # restore F24\n"
-"    l.d  $f25, 8($sp)   # restore F25\n"
-"    l.d  $f26, 16($sp)  # restore F26\n"
-"    l.d  $f27, 24($sp)  # restore F27\n"
-"    l.d  $f28, 32($sp)  # restore F28\n"
-"    l.d  $f29, 40($sp)  # restore F29\n"
-"    l.d  $f30, 48($sp)  # restore F30\n"
-"    l.d  $f31, 56($sp)  # restore F31\n"
-"    ld  $s0, 64($sp)  # restore S0\n"
-"    ld  $s1, 72($sp)  # restore S1\n"
-"    ld  $s2, 80($sp)  # restore S2\n"
-"    ld  $s3, 88($sp)  # restore S3\n"
-"    ld  $s4, 96($sp)  # restore S4\n"
-"    ld  $s5, 104($sp) # restore S5\n"
-"    ld  $s6, 112($sp) # restore S6\n"
-"    ld  $s7, 120($sp) # restore S7\n"
-"    ld  $fp, 128($sp) # restore FP\n"
-"    ld  $ra, 144($sp) # restore RA\n"
-"    # load PC\n"
-"    ld  $t9, 152($sp)\n"
-"    sd  $a2, 160($sp)\n"
-"    # adjust stack\n"
-"    daddiu $sp, $sp, 176\n"
-"    move  $a0, $a2 # move *data from a2 to a0 as param\n"
-"    move  $v0, $a2 # move *data from a2 to v0 as return\n"
-"    # jump to context\n"
-"    jr  $t9\n"
-"    nop\n"
-".end jump_fcontext\n"
-".size jump_fcontext, .-jump_fcontext\n"
-".section .note.GNU-stack,\"\",%progbits\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_linux_mips_n64) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".globl make_fcontext\n"
-".align 2\n"
-".set noreorder\n"
-".type make_fcontext,@function\n"
-".ent make_fcontext\n"
-"make_fcontext:\n"
-"#ifdef __PIC__\n"
-".set    noreorder\n"
-".cpload $t9\n"
-".set    reorder\n"
-"#endif\n"
-"    # shift address in A0 to lower 16 byte boundary\n"
-"    li $v1, 0xfffffffffffffff0\n"
-"    and $v0, $v1, $a0\n"
-"    # reserve space for context-data on context-stack\n"
-"    daddiu $v0, $v0, -176\n"
-"    # third arg of make_fcontext() == address of context-function\n"
-"    sd  $a2, 152($v0)\n"
-"    # save global pointer in context-data\n"
-"    sd  $gp, 136($v0)\n"
-"    # psudo instruction compute abs address of label finish based on GP\n"
-"    dla  $t9, finish\n"
-"    # save address of finish as return-address for context-function\n"
-"    # will be entered after context-function returns\n"
-"    sd  $t9, 144($v0)\n"
-"    jr  $ra # return pointer to context-data\n"
-"    nop\n"
-"finish:\n"
-"    # reload our gp register (needed for la)\n"
-"    daddiu $t0, $sp, -176\n"
-"    ld $gp, 136($t0)\n"
-"    ld $v0, 160($t0)\n"
-"    # call _exit(0)\n"
-"    dla $t9, _exit\n"
-"    move $a0, $zero\n"
-"    jr $t9\n"
-"    nop\n"
-".end make_fcontext\n"
-".size make_fcontext, .-make_fcontext\n"
-".section .note.GNU-stack,\"\",%progbits\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_linux_ppc32) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".globl jump_fcontext\n"
-".align 2\n"
-".type jump_fcontext,@function\n"
-"jump_fcontext:\n"
-"    # reserve space on stack\n"
-"    subi  %r1, %r1, 240\n"
-"    stw  %r13, 152(%r1)  # save R13\n"
-"    stw  %r14, 156(%r1)  # save R14\n"
-"    stw  %r15, 160(%r1)  # save R15\n"
-"    stw  %r16, 164(%r1)  # save R16\n"
-"    stw  %r17, 168(%r1)  # save R17\n"
-"    stw  %r18, 172(%r1)  # save R18\n"
-"    stw  %r19, 176(%r1)  # save R19\n"
-"    stw  %r20, 180(%r1)  # save R20\n"
-"    stw  %r21, 184(%r1)  # save R21\n"
-"    stw  %r22, 188(%r1)  # save R22\n"
-"    stw  %r23, 192(%r1)  # save R23\n"
-"    stw  %r24, 196(%r1)  # save R24\n"
-"    stw  %r25, 200(%r1)  # save R25\n"
-"    stw  %r26, 204(%r1)  # save R26\n"
-"    stw  %r27, 208(%r1)  # save R27\n"
-"    stw  %r28, 212(%r1)  # save R28\n"
-"    stw  %r29, 216(%r1)  # save R29\n"
-"    stw  %r30, 220(%r1)  # save R30\n"
-"    stw  %r31, 224(%r1)  # save R31\n"
-"    # save CR\n"
-"    mfcr  %r0\n"
-"    stw  %r0, 228(%r1)\n"
-"    # save LR\n"
-"    mflr  %r0\n"
-"    stw  %r0, 232(%r1)\n"
-"    # save LR as PC\n"
-"    stw  %r0, 236(%r1)\n"
-"    # test if fpu env should be preserved\n"
-"    cmpwi  cr7, %r6, 0\n"
-"    beq  cr7, 1f\n"
-"    stfd  %f14, 0(%r1)  # save F14\n"
-"    stfd  %f15, 8(%r1)  # save F15\n"
-"    stfd  %f16, 16(%r1)  # save F16\n"
-"    stfd  %f17, 24(%r1)  # save F17\n"
-"    stfd  %f18, 32(%r1)  # save F18\n"
-"    stfd  %f19, 40(%r1)  # save F19\n"
-"    stfd  %f20, 48(%r1)  # save F20\n"
-"    stfd  %f21, 56(%r1)  # save F21\n"
-"    stfd  %f22, 64(%r1)  # save F22\n"
-"    stfd  %f23, 72(%r1)  # save F23\n"
-"    stfd  %f24, 80(%r1)  # save F24\n"
-"    stfd  %f25, 88(%r1)  # save F25\n"
-"    stfd  %f26, 96(%r1)  # save F26\n"
-"    stfd  %f27, 104(%r1)  # save F27\n"
-"    stfd  %f28, 112(%r1)  # save F28\n"
-"    stfd  %f29, 120(%r1)  # save F29\n"
-"    stfd  %f30, 128(%r1)  # save F30\n"
-"    stfd  %f31, 136(%r1)  # save F31\n"
-"    mffs  %f0  # load FPSCR\n"
-"    stfd  %f0, 144(%r1)  # save FPSCR\n"
-"1:\n"
-"    # store RSP (pointing to context-data) in R3\n"
-"    stw  %r1, 0(%r3)\n"
-"    # restore RSP (pointing to context-data) from R4\n"
-"    mr  %r1, %r4\n"
-"    # test if fpu env should be preserved\n"
-"    cmpwi  cr7, %r6, 0\n"
-"    beq  cr7, 2f\n"
-"    lfd  %f14, 0(%r1)  # restore F14\n"
-"    lfd  %f15, 8(%r1)  # restore F15\n"
-"    lfd  %f16, 16(%r1)  # restore F16\n"
-"    lfd  %f17, 24(%r1)  # restore F17\n"
-"    lfd  %f18, 32(%r1)  # restore F18\n"
-"    lfd  %f19, 40(%r1)  # restore F19\n"
-"    lfd  %f20, 48(%r1)  # restore F20\n"
-"    lfd  %f21, 56(%r1)  # restore F21\n"
-"    lfd  %f22, 64(%r1)  # restore F22\n"
-"    lfd  %f23, 72(%r1)  # restore F23\n"
-"    lfd  %f24, 80(%r1)  # restore F24\n"
-"    lfd  %f25, 88(%r1)  # restore F25\n"
-"    lfd  %f26, 96(%r1)  # restore F26\n"
-"    lfd  %f27, 104(%r1)  # restore F27\n"
-"    lfd  %f28, 112(%r1)  # restore F28\n"
-"    lfd  %f29, 120(%r1)  # restore F29\n"
-"    lfd  %f30, 128(%r1)  # restore F30\n"
-"    lfd  %f31, 136(%r1)  # restore F31\n"
-"    lfd  %f0,  144(%r1)  # load FPSCR\n"
-"    mtfsf  0xff, %f0  # restore FPSCR\n"
-"2:\n"
-"    lwz  %r13, 152(%r1)  # restore R13\n"
-"    lwz  %r14, 156(%r1)  # restore R14\n"
-"    lwz  %r15, 160(%r1)  # restore R15\n"
-"    lwz  %r16, 164(%r1)  # restore R16\n"
-"    lwz  %r17, 168(%r1)  # restore R17\n"
-"    lwz  %r18, 172(%r1)  # restore R18\n"
-"    lwz  %r19, 176(%r1)  # restore R19\n"
-"    lwz  %r20, 180(%r1)  # restore R20\n"
-"    lwz  %r21, 184(%r1)  # restore R21\n"
-"    lwz  %r22, 188(%r1)  # restore R22\n"
-"    lwz  %r23, 192(%r1)  # restore R23\n"
-"    lwz  %r24, 196(%r1)  # restore R24\n"
-"    lwz  %r25, 200(%r1)  # restore R25\n"
-"    lwz  %r26, 204(%r1)  # restore R26\n"
-"    lwz  %r27, 208(%r1)  # restore R27\n"
-"    lwz  %r28, 212(%r1)  # restore R28\n"
-"    lwz  %r29, 216(%r1)  # restore R29\n"
-"    lwz  %r30, 220(%r1)  # restore R30\n"
-"    lwz  %r31, 224(%r1)  # restore R31\n"
-"    # restore CR\n"
-"    lwz  %r0, 228(%r1)\n"
-"    mtcr  %r0\n"
-"    # restore LR\n"
-"    lwz  %r0, 232(%r1)\n"
-"    mtlr  %r0\n"
-"    # load PC\n"
-"    lwz  %r0, 236(%r1)\n"
-"    # restore CTR\n"
-"    mtctr  %r0\n"
-"    # adjust stack\n"
-"    addi  %r1, %r1, 240\n"
-"    # use third arg as return value after jump\n"
-"    # use third arg as first arg in context function\n"
-"    mr  %r3, %r5\n"
-"    # jump to context\n"
-"    bctr\n"
-".size jump_fcontext, .-jump_fcontext\n"
-".section .note.GNU-stack,\"\",%progbits\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_linux_ppc32) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".text\n"
-".globl make_fcontext\n"
-".align 2\n"
-".type make_fcontext,@function\n"
-"make_fcontext:\n"
-"    # save return address into R6\n"
-"    mflr  %r6\n"
-"    # first arg of make_fcontext() == top address of context-function\n"
-"    # shift address in R3 to lower 16 byte boundary\n"
-"    clrrwi  %r3, %r3, 4\n"
-"    # reserve space for context-data on context-stack\n"
-"    # including 64 byte of linkage + parameter area (R1 % 16 == 0)\n"
-"    subi  %r3, %r3, 304\n"
-"    # third arg of make_fcontext() == address of context-function\n"
-"    stw  %r5, 236(%r3)\n"
-"    # load LR\n"
-"    mflr  %r0\n"
-"    # jump to label 1\n"
-"    bl  1f\n"
-"1:\n"
-"    # load LR into R4\n"
-"    mflr  %r4\n"
-"    # compute abs address of label finish\n"
-"    addi  %r4, %r4, finish - 1b\n"
-"    # restore LR\n"
-"    mtlr  %r0\n"
-"    # save address of finish as return-address for context-function\n"
-"    # will be entered after context-function returns\n"
-"    stw  %r4, 232(%r3)\n"
-"    # restore return address from R6\n"
-"    mtlr  %r6\n"
-"    blr  # return pointer to context-data\n"
-"finish:\n"
-"    # save return address into R0\n"
-"    mflr  %r0\n"
-"    # save return address on stack, set up stack frame\n"
-"    stw  %r0, 4(%r1)\n"
-"    # allocate stack space, R1 % 16 == 0\n"
-"    stwu  %r1, -16(%r1)\n"
-"    # exit code is zero\n"
-"    li  %r3, 0\n"
-"    # exit application\n"
-"    bl  _exit@plt\n"
-".size make_fcontext, .-make_fcontext\n"
-".section .note.GNU-stack,\"\",%progbits\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_linux_ppc64) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".globl jump_fcontext\n"
-#if _CALL_ELF == 2
-"  .text\n"
-"  .align 2\n"
-"jump_fcontext:\n"
-"        addis   %r2, %r12, .TOC.-jump_fcontext@ha\n"
-"        addi    %r2, %r2, .TOC.-jump_fcontext@l\n"
-"        .localentry jump_fcontext, . - jump_fcontext\n"
-#else
-"  .section \".opd\",\"aw\"\n"
-"  .align 3\n"
-"jump_fcontext:\n"
-# ifdef _CALL_LINUX
-"        .quad   .L.jump_fcontext,.TOC.@tocbase,0\n"
-"        .type   jump_fcontext,@function\n"
-"        .text\n"
-"        .align 2\n"
-".L.jump_fcontext:\n"
-# else
-"        .hidden .jump_fcontext\n"
-"        .globl  .jump_fcontext\n"
-"        .quad   .jump_fcontext,.TOC.@tocbase,0\n"
-"        .size   jump_fcontext,24\n"
-"        .type   .jump_fcontext,@function\n"
-"        .text\n"
-"        .align 2\n"
-".jump_fcontext:\n"
-# endif
-#endif
-"    # reserve space on stack\n"
-"    subi  %r1, %r1, 328\n"
-#if _CALL_ELF != 2
-"    std  %r2,  152(%r1)  # save TOC\n"
-#endif
-"    std  %r14, 160(%r1)  # save R14\n"
-"    std  %r15, 168(%r1)  # save R15\n"
-"    std  %r16, 176(%r1)  # save R16\n"
-"    std  %r17, 184(%r1)  # save R17\n"
-"    std  %r18, 192(%r1)  # save R18\n"
-"    std  %r19, 200(%r1)  # save R19\n"
-"    std  %r20, 208(%r1)  # save R20\n"
-"    std  %r21, 216(%r1)  # save R21\n"
-"    std  %r22, 224(%r1)  # save R22\n"
-"    std  %r23, 232(%r1)  # save R23\n"
-"    std  %r24, 240(%r1)  # save R24\n"
-"    std  %r25, 248(%r1)  # save R25\n"
-"    std  %r26, 256(%r1)  # save R26\n"
-"    std  %r27, 264(%r1)  # save R27\n"
-"    std  %r28, 272(%r1)  # save R28\n"
-"    std  %r29, 280(%r1)  # save R29\n"
-"    std  %r30, 288(%r1)  # save R30\n"
-"    std  %r31, 296(%r1)  # save R31\n"
-"    # save CR\n"
-"    mfcr  %r0\n"
-"    std  %r0, 304(%r1)\n"
-"    # save LR\n"
-"    mflr  %r0\n"
-"    std  %r0, 312(%r1)\n"
-"    # save LR as PC\n"
-"    std  %r0, 320(%r1)\n"
-"    # test if fpu env should be preserved\n"
-"    cmpwi  cr7, %r6, 0\n"
-"    beq  cr7, 1f\n"
-"    stfd  %f14, 0(%r1)  # save F14\n"
-"    stfd  %f15, 8(%r1)  # save F15\n"
-"    stfd  %f16, 16(%r1)  # save F16\n"
-"    stfd  %f17, 24(%r1)  # save F17\n"
-"    stfd  %f18, 32(%r1)  # save F18\n"
-"    stfd  %f19, 40(%r1)  # save F19\n"
-"    stfd  %f20, 48(%r1)  # save F20\n"
-"    stfd  %f21, 56(%r1)  # save F21\n"
-"    stfd  %f22, 64(%r1)  # save F22\n"
-"    stfd  %f23, 72(%r1)  # save F23\n"
-"    stfd  %f24, 80(%r1)  # save F24\n"
-"    stfd  %f25, 88(%r1)  # save F25\n"
-"    stfd  %f26, 96(%r1)  # save F26\n"
-"    stfd  %f27, 104(%r1)  # save F27\n"
-"    stfd  %f28, 112(%r1)  # save F28\n"
-"    stfd  %f29, 120(%r1)  # save F29\n"
-"    stfd  %f30, 128(%r1)  # save F30\n"
-"    stfd  %f31, 136(%r1)  # save F31\n"
-"    mffs  %f0  # load FPSCR\n"
-"    stfd  %f0, 144(%r1)  # save FPSCR\n"
-"1:\n"
-"    # store RSP (pointing to context-data) in R3\n"
-"    std  %r1, 0(%r3)\n"
-"    # restore RSP (pointing to context-data) from R4\n"
-"    mr  %r1, %r4\n"
-"    # test if fpu env should be preserved\n"
-"    cmpwi  cr7, %r6, 0\n"
-"    beq  cr7, 2f\n"
-"    lfd  %f14, 0(%r1)  # restore F14\n"
-"    lfd  %f15, 8(%r1)  # restore F15\n"
-"    lfd  %f16, 16(%r1)  # restore F16\n"
-"    lfd  %f17, 24(%r1)  # restore F17\n"
-"    lfd  %f18, 32(%r1)  # restore F18\n"
-"    lfd  %f19, 40(%r1)  # restore F19\n"
-"    lfd  %f20, 48(%r1)  # restore F20\n"
-"    lfd  %f21, 56(%r1)  # restore F21\n"
-"    lfd  %f22, 64(%r1)  # restore F22\n"
-"    lfd  %f23, 72(%r1)  # restore F23\n"
-"    lfd  %f24, 80(%r1)  # restore F24\n"
-"    lfd  %f25, 88(%r1)  # restore F25\n"
-"    lfd  %f26, 96(%r1)  # restore F26\n"
-"    lfd  %f27, 104(%r1)  # restore F27\n"
-"    lfd  %f28, 112(%r1)  # restore F28\n"
-"    lfd  %f29, 120(%r1)  # restore F29\n"
-"    lfd  %f30, 128(%r1)  # restore F30\n"
-"    lfd  %f31, 136(%r1)  # restore F31\n"
-"    lfd  %f0,  144(%r1)  # load FPSCR\n"
-"    mtfsf  0xff, %f0  # restore FPSCR\n"
-"2:\n"
-#if _CALL_ELF != 2
-"    ld  %r2,  152(%r1)  # restore TOC\n"
-#endif
-"    ld  %r14, 160(%r1)  # restore R14\n"
-"    ld  %r15, 168(%r1)  # restore R15\n"
-"    ld  %r16, 176(%r1)  # restore R16\n"
-"    ld  %r17, 184(%r1)  # restore R17\n"
-"    ld  %r18, 192(%r1)  # restore R18\n"
-"    ld  %r19, 200(%r1)  # restore R19\n"
-"    ld  %r20, 208(%r1)  # restore R20\n"
-"    ld  %r21, 216(%r1)  # restore R21\n"
-"    ld  %r22, 224(%r1)  # restore R22\n"
-"    ld  %r23, 232(%r1)  # restore R23\n"
-"    ld  %r24, 240(%r1)  # restore R24\n"
-"    ld  %r25, 248(%r1)  # restore R25\n"
-"    ld  %r26, 256(%r1)  # restore R26\n"
-"    ld  %r27, 264(%r1)  # restore R27\n"
-"    ld  %r28, 272(%r1)  # restore R28\n"
-"    ld  %r29, 280(%r1)  # restore R29\n"
-"    ld  %r30, 288(%r1)  # restore R30\n"
-"    ld  %r31, 296(%r1)  # restore R31\n"
-"    # restore CR\n"
-"    ld  %r0, 304(%r1)\n"
-"    mtcr  %r0\n"
-"    # restore LR\n"
-"    ld  %r0, 312(%r1)\n"
-"    mtlr  %r0\n"
-"    # load PC\n"
-"    ld  %r12, 320(%r1)\n"
-"    # restore CTR\n"
-"    mtctr  %r12\n"
-"    # adjust stack\n"
-"    addi  %r1, %r1, 328\n"
-"    # use third arg as return value after jump\n"
-"    # use third arg as first arg in context function\n"
-"    mr  %r3, %r5\n"
-"    # jump to context\n"
-"    bctr\n"
-#if _CALL_ELF == 2
-"  .size jump_fcontext, .-jump_fcontext\n"
-#else
-# ifdef _CALL_LINUX
-"  .size .jump_fcontext, .-.L.jump_fcontext\n"
-# else
-"  .size .jump_fcontext, .-.jump_fcontext\n"
-# endif
-#endif
-".section .note.GNU-stack,\"\",%progbits\n"
-);
-
-#endif
-
-#if defined(LIBCONTEXT_PLATFORM_linux_ppc64) && defined(LIBCONTEXT_COMPILER_gcc)
-__asm (
-".globl make_fcontext\n"
-#if _CALL_ELF == 2
-"  .text\n"
-"  .align 2\n"
-"make_fcontext:\n"
-"  addis   %r2, %r12, .TOC.-make_fcontext@ha\n"
-"  addi    %r2, %r2, .TOC.-make_fcontext@l\n"
-"  .localentry make_fcontext, . - make_fcontext\n"
-#else
-"  .section \".opd\",\"aw\"\n"
-"  .align 3\n"
-"make_fcontext:\n"
-# ifdef _CALL_LINUX
-"  .quad   .L.make_fcontext,.TOC.@tocbase,0\n"
-"  .type   make_fcontext,@function\n"
-"  .text\n"
-"  .align 2\n"
-".L.make_fcontext:\n"
-# else
-"  .hidden .make_fcontext\n"
-"  .globl  .make_fcontext\n"
-"  .quad   .make_fcontext,.TOC.@tocbase,0\n"
-"  .size   make_fcontext,24\n"
-"  .type   .make_fcontext,@function\n"
-"  .text\n"
-"  .align 2\n"
-".make_fcontext:\n"
-# endif
-#endif
-"    # save return address into R6\n"
-"    mflr  %r6\n"
-"    # first arg of make_fcontext() == top address of context-stack\n"
-"    # shift address in R3 to lower 16 byte boundary\n"
-"    clrrdi  %r3, %r3, 4\n"
-"    # reserve space for context-data on context-stack\n"
-"    # including 64 byte of linkage + parameter area (R1 % 16 == 0)\n"
-"    subi  %r3, %r3, 392\n"
-"    # third arg of make_fcontext() == address of context-function\n"
-"    # entry point (ELFv2) or descriptor (ELFv1)\n"
-#if _CALL_ELF == 2
-"    # save address of context-function entry point\n"
-"    std  %r5, 320(%r3)\n"
-#else
-"    # save address of context-function entry point\n"
-"    ld   %r4, 0(%r5)\n"
-"    std  %r4, 320(%r3)\n"
-"    # save TOC of context-function\n"
-"    ld   %r4, 8(%r5)\n"
-"    std  %r4, 152(%r3)\n"
-#endif
-"    # load LR\n"
-"    mflr  %r0\n"
-"    # jump to label 1\n"
-"    bl  1f\n"
-"1:\n"
-"    # load LR into R4\n"
-"    mflr  %r4\n"
-"    # compute abs address of label finish\n"
-"    addi  %r4, %r4, finish - 1b\n"
-"    # restore LR\n"
-"    mtlr  %r0\n"
-"    # save address of finish as return-address for context-function\n"
-"    # will be entered after context-function returns\n"
-"    std  %r4, 312(%r3)\n"
-"    # restore return address from R6\n"
-"    mtlr  %r6\n"
-"    blr  # return pointer to context-data\n"
-"finish:\n"
-"    # save return address into R0\n"
-"    mflr  %r0\n"
-"    # save return address on stack, set up stack frame\n"
-"    std  %r0, 8(%r1)\n"
-"    # allocate stack space, R1 % 16 == 0\n"
-"    stdu  %r1, -32(%r1)\n"
-"    # exit code is zero\n"
-"    li  %r3, 0\n"
-"    # exit application\n"
-"    bl  _exit\n"
-"    nop\n"
-#if _CALL_ELF == 2
-"  .size make_fcontext, .-make_fcontext\n"
-#else
-# ifdef _CALL_LINUX
-"  .size .make_fcontext, .-.L.make_fcontext\n"
-# else
-"  .size .make_fcontext, .-.make_fcontext\n"
-# endif
-#endif
-".section .note.GNU-stack,\"\",%progbits\n"
-);
-
-#endif
+/*
+
+    auto-generated file, do not modify!
+    libcontext - a slightly more portable version of boost::context
+    Copyright Martin Husemann 2013.
+    Copyright Oliver Kowalke 2009.
+    Copyright Sergue E. Leontiev 2013
+    Copyright Thomas Sailer 2013.
+    Minor modifications by Tomasz Wlostowski 2016.
+
+ Distributed under the Boost Software License, Version 1.0.
+      (See accompanying file LICENSE.BOOSTv1_0.txt or copy at
+            http://www.boost.org/LICENSE_1_0.txt)
+
+*/
+#include <stdlib.h>
+#include <setjmp.h>
+#include <system/libcontext.h>
+
+#if defined(LIBCONTEXT_PLATFORM_windows_i386) && defined(LIBCONTEXT_COMPILER_gcc)
+__asm (
+".text\n"
+".p2align 4,,15\n"
+".globl	_jump_fcontext\n"
+".def	_jump_fcontext;	.scl	2;	.type	32;	.endef\n"
+"_jump_fcontext:\n"
+"    mov    0x10(%esp),%ecx\n"
+"    push   %ebp\n"
+"    push   %ebx\n"
+"    push   %esi\n"
+"    push   %edi\n"
+"    mov    %fs:0x18,%edx\n"
+"    mov    (%edx),%eax\n"
+"    push   %eax\n"
+"    mov    0x4(%edx),%eax\n"
+"    push   %eax\n"
+"    mov    0x8(%edx),%eax\n"
+"    push   %eax\n"
+"    mov    0xe0c(%edx),%eax\n"
+"    push   %eax\n"
+"    mov    0x10(%edx),%eax\n"
+"    push   %eax\n"
+"    lea    -0x8(%esp),%esp\n"
+"    test   %ecx,%ecx\n"
+"    je     nxt1\n"
+"    stmxcsr (%esp)\n"
+"    fnstcw 0x4(%esp)\n"
+"nxt1:\n"
+"    mov    0x30(%esp),%eax\n"
+"    mov    %esp,(%eax)\n"
+"    mov    0x34(%esp),%edx\n"
+"    mov    0x38(%esp),%eax\n"
+"    mov    %edx,%esp\n"
+"    test   %ecx,%ecx\n"
+"    je     nxt2\n"
+"    ldmxcsr (%esp)\n"
+"    fldcw  0x4(%esp)\n"
+"nxt2:\n"
+"    lea    0x8(%esp),%esp\n"
+"    mov    %fs:0x18,%edx\n"
+"    pop    %ecx\n"
+"    mov    %ecx,0x10(%edx)\n"
+"    pop    %ecx\n"
+"    mov    %ecx,0xe0c(%edx)\n"
+"    pop    %ecx\n"
+"    mov    %ecx,0x8(%edx)\n"
+"    pop    %ecx\n"
+"    mov    %ecx,0x4(%edx)\n"
+"    pop    %ecx\n"
+"    mov    %ecx,(%edx)\n"
+"    pop    %edi\n"
+"    pop    %esi\n"
+"    pop    %ebx\n"
+"    pop    %ebp\n"
+"    pop    %edx\n"
+"    mov    %eax,0x4(%esp)\n"
+"    jmp    *%edx\n"
+);
+
+#endif
+
+#if defined(LIBCONTEXT_PLATFORM_windows_i386) && defined(LIBCONTEXT_COMPILER_gcc)
+__asm (
+".text\n"
+".p2align 4,,15\n"
+".globl	_make_fcontext\n"
+".def	_make_fcontext;	.scl	2;	.type	32;	.endef\n"
+"_make_fcontext:\n"
+"mov    0x4(%esp),%eax\n"
+"lea    -0x8(%eax),%eax\n"
+"and    $0xfffffff0,%eax\n"
+"lea    -0x3c(%eax),%eax\n"
+"mov    0x4(%esp),%ecx\n"
+"mov    %ecx,0x14(%eax)\n"
+"mov    0x8(%esp),%edx\n"
+"neg    %edx\n"
+"lea    (%ecx,%edx,1),%ecx\n"
+"mov    %ecx,0x10(%eax)\n"
+"mov    %ecx,0xc(%eax)\n"
+"mov    0xc(%esp),%ecx\n"
+"mov    %ecx,0x2c(%eax)\n"
+"stmxcsr (%eax)\n"
+"fnstcw 0x4(%eax)\n"
+"mov    $finish,%ecx\n"
+"mov    %ecx,0x30(%eax)\n"
+"mov    %fs:0x0,%ecx\n"
+"walk:\n"
+"mov    (%ecx),%edx\n"
+"inc    %edx\n"
+"je     found\n"
+"dec    %edx\n"
+"xchg   %edx,%ecx\n"
+"jmp    walk\n"
+"found:\n"
+"mov    0x4(%ecx),%ecx\n"
+"mov    %ecx,0x3c(%eax)\n"
+"mov    $0xffffffff,%ecx\n"
+"mov    %ecx,0x38(%eax)\n"
+"lea    0x38(%eax),%ecx\n"
+"mov    %ecx,0x18(%eax)\n"
+"ret\n"
+"finish:\n"
+"xor    %eax,%eax\n"
+"mov    %eax,(%esp)\n"
+"call   _exit\n"
+"hlt\n"
+".def	__exit;	.scl	2;	.type	32;	.endef  \n"
+);
+
+#endif
+
+#if defined(LIBCONTEXT_PLATFORM_windows_x86_64) && defined(LIBCONTEXT_COMPILER_gcc)
+__asm (
+".text\n"
+".p2align 4,,15\n"
+".globl	jump_fcontext\n"
+".def	jump_fcontext;	.scl	2;	.type	32;	.endef\n"
+".seh_proc	jump_fcontext\n"
+"jump_fcontext:\n"
+".seh_endprologue\n"
+"	push   %rbp\n"
+"	push   %rbx\n"
+"	push   %rsi\n"
+"	push   %rdi\n"
+"	push   %r15\n"
+"	push   %r14\n"
+"	push   %r13\n"
+"	push   %r12\n"
+"	mov    %gs:0x30,%r10\n"
+"	mov    0x8(%r10),%rax\n"
+"	push   %rax\n"
+"	mov    0x10(%r10),%rax\n"
+"	push   %rax\n"
+"	mov    0x1478(%r10),%rax\n"
+"	push   %rax\n"
+"	mov    0x18(%r10),%rax\n"
+"	push   %rax\n"
+"	lea    -0xa8(%rsp),%rsp\n"
+"	test   %r9,%r9\n"
+"	je     nxt1\n"
+"	stmxcsr 0xa0(%rsp)\n"
+"	fnstcw 0xa4(%rsp)\n"
+"	movaps %xmm6,(%rsp)\n"
+"	movaps %xmm7,0x10(%rsp)\n"
+"	movaps %xmm8,0x20(%rsp)\n"
+"	movaps %xmm9,0x30(%rsp)\n"
+"	movaps %xmm10,0x40(%rsp)\n"
+"	movaps %xmm11,0x50(%rsp)\n"
+"	movaps %xmm12,0x60(%rsp)\n"
+"	movaps %xmm13,0x70(%rsp)\n"
+"	movaps %xmm14,0x80(%rsp)\n"
+"	movaps %xmm15,0x90(%rsp)\n"
+"nxt1:\n"
+"	xor    %r10,%r10\n"
+"	push   %r10\n"
+"	mov    %rsp,(%rcx)\n"
+"	mov    %rdx,%rsp\n"
+"	pop    %r10\n"
+"	test   %r9,%r9\n"
+"	je     nxt2\n"
+"	ldmxcsr 0xa0(%rsp)\n"
+"	fldcw  0xa4(%rsp)\n"
+"	movaps (%rsp),%xmm6\n"
+"	movaps 0x10(%rsp),%xmm7\n"
+"	movaps 0x20(%rsp),%xmm8\n"
+"	movaps 0x30(%rsp),%xmm9\n"
+"	movaps 0x40(%rsp),%xmm10\n"
+"	movaps 0x50(%rsp),%xmm11\n"
+"	movaps 0x60(%rsp),%xmm12\n"
+"	movaps 0x70(%rsp),%xmm13\n"
+"	movaps 0x80(%rsp),%xmm14\n"
+"	movaps 0x90(%rsp),%xmm15\n"
+"nxt2:\n"
+"	mov    $0xa8,%rcx\n"
+"    test   %r10,%r10\n"
+"    je     nxt3\n"
+"    add    $0x8,%rcx\n"
+"nxt3:\n"
+"	lea    (%rsp,%rcx,1),%rsp\n"
+"	mov    %gs:0x30,%r10\n"
+"	pop    %rax\n"
+"	mov    %rax,0x18(%r10)\n"
+"	pop    %rax\n"
+"	mov    %rax,0x1478(%r10)\n"
+"	pop    %rax\n"
+"	mov    %rax,0x10(%r10)\n"
+"	pop    %rax\n"
+"	mov    %rax,0x8(%r10)\n"
+"	pop    %r12\n"
+"	pop    %r13\n"
+"	pop    %r14\n"
+"	pop    %r15\n"
+"	pop    %rdi\n"
+"	pop    %rsi\n"
+"	pop    %rbx\n"
+"	pop    %rbp\n"
+"	pop    %r10\n"
+"	mov    %r8,%rax\n"
+"	mov    %r8,%rcx\n"
+"	jmpq   *%r10\n"
+".seh_endproc\n"
+);
+
+#endif
+
+#if defined(LIBCONTEXT_PLATFORM_windows_x86_64) && defined(LIBCONTEXT_COMPILER_gcc)
+__asm (
+".text\n"
+".p2align 4,,15\n"
+".globl	make_fcontext\n"
+".def	make_fcontext;	.scl	2;	.type	32;	.endef\n"
+".seh_proc	make_fcontext\n"
+"make_fcontext:\n"
+".seh_endprologue\n"
+"mov    %rcx,%rax\n"
+"sub    $0x28,%rax\n"
+"and    $0xfffffffffffffff0,%rax\n"
+"sub    $0x128,%rax\n"
+"mov    %r8,0x118(%rax)\n"
+"mov    %rcx,0xd0(%rax)\n"
+"neg    %rdx\n"
+"lea    (%rcx,%rdx,1),%rcx\n"
+"mov    %rcx,0xc8(%rax)\n"
+"mov    %rcx,0xc0(%rax)\n"
+"stmxcsr 0xa8(%rax)\n"
+"fnstcw 0xac(%rax)\n"
+"leaq  finish(%rip), %rcx\n"
+"mov    %rcx,0x120(%rax)\n"
+"mov    $0x1,%rcx\n"
+"mov    %rcx,(%rax)\n"
+"retq\n"
+"finish:\n"
+"xor    %rcx,%rcx\n"
+"callq  0x63\n"
+"hlt\n"
+"   .seh_endproc\n"
+".def	_exit;	.scl	2;	.type	32;	.endef  \n"
+);
+
+#endif
+
+#if defined(LIBCONTEXT_PLATFORM_linux_i386) && defined(LIBCONTEXT_COMPILER_gcc)
+__asm (
+".text\n"
+".globl jump_fcontext\n"
+".align 2\n"
+".type jump_fcontext,@function\n"
+"jump_fcontext:\n"
+"    movl  0x10(%esp), %ecx\n"
+"    pushl  %ebp  \n"
+"    pushl  %ebx  \n"
+"    pushl  %esi  \n"
+"    pushl  %edi  \n"
+"    leal  -0x8(%esp), %esp\n"
+"    test  %ecx, %ecx\n"
+"    je  1f\n"
+"    stmxcsr  (%esp)\n"
+"    fnstcw  0x4(%esp)\n"
+"1:\n"
+"    movl  0x1c(%esp), %eax\n"
+"    movl  %esp, (%eax)\n"
+"    movl  0x20(%esp), %edx\n"
+"    movl  0x24(%esp), %eax\n"
+"    movl  %edx, %esp\n"
+"    test  %ecx, %ecx\n"
+"    je  2f\n"
+"    ldmxcsr  (%esp)\n"
+"    fldcw  0x4(%esp)\n"
+"2:\n"
+"    leal  0x8(%esp), %esp\n"
+"    popl  %edi  \n"
+"    popl  %esi  \n"
+"    popl  %ebx  \n"
+"    popl  %ebp  \n"
+"    popl  %edx\n"
+"    movl  %eax, 0x4(%esp)\n"
+"    jmp  *%edx\n"
+".size jump_fcontext,.-jump_fcontext\n"
+".section .note.GNU-stack,\"\",%progbits\n"
+);
+
+#endif
+
+#if defined(LIBCONTEXT_PLATFORM_linux_i386) && defined(LIBCONTEXT_COMPILER_gcc)
+__asm (
+".text\n"
+".globl make_fcontext\n"
+".align 2\n"
+".type make_fcontext,@function\n"
+"make_fcontext:\n"
+"    movl  0x4(%esp), %eax\n"
+"    leal  -0x8(%eax), %eax\n"
+"    andl  $-16, %eax\n"
+"    leal  -0x20(%eax), %eax\n"
+"    movl  0xc(%esp), %edx\n"
+"    movl  %edx, 0x18(%eax)\n"
+"    stmxcsr  (%eax)\n"
+"    fnstcw  0x4(%eax)\n"
+"    call  1f\n"
+"1:  popl  %ecx\n"
+"    addl  $finish-1b, %ecx\n"
+"    movl  %ecx, 0x1c(%eax)\n"
+"    ret \n"
+"finish:\n"
+"    call  2f\n"
+"2:  popl  %ebx\n"
+"    addl  $_GLOBAL_OFFSET_TABLE_+[.-2b], %ebx\n"
+"    xorl  %eax, %eax\n"
+"    movl  %eax, (%esp)\n"
+"    call  _exit@PLT\n"
+"    hlt\n"
+".size make_fcontext,.-make_fcontext\n"
+".section .note.GNU-stack,\"\",%progbits\n"
+);
+
+#endif
+
+#if defined(LIBCONTEXT_PLATFORM_linux_x86_64) && defined(LIBCONTEXT_COMPILER_gcc)
+__asm (
+".text\n"
+".globl jump_fcontext\n"
+".type jump_fcontext,@function\n"
+".align 16\n"
+"jump_fcontext:\n"
+"    pushq  %rbp  \n"
+"    pushq  %rbx  \n"
+"    pushq  %r15  \n"
+"    pushq  %r14  \n"
+"    pushq  %r13  \n"
+"    pushq  %r12  \n"
+"    leaq  -0x8(%rsp), %rsp\n"
+"    cmp  $0, %rcx\n"
+"    je  1f\n"
+"    stmxcsr  (%rsp)\n"
+"    fnstcw   0x4(%rsp)\n"
+"1:\n"
+"    movq  %rsp, (%rdi)\n"
+"    movq  %rsi, %rsp\n"
+"    cmp  $0, %rcx\n"
+"    je  2f\n"
+"    ldmxcsr  (%rsp)\n"
+"    fldcw  0x4(%rsp)\n"
+"2:\n"
+"    leaq  0x8(%rsp), %rsp\n"
+"    popq  %r12  \n"
+"    popq  %r13  \n"
+"    popq  %r14  \n"
+"    popq  %r15  \n"
+"    popq  %rbx  \n"
+"    popq  %rbp  \n"
+"    popq  %r8\n"
+"    movq  %rdx, %rax\n"
+"    movq  %rdx, %rdi\n"
+"    jmp  *%r8\n"
+".size jump_fcontext,.-jump_fcontext\n"
+".section .note.GNU-stack,\"\",%progbits\n"
+);
+
+#endif
+
+#if defined(LIBCONTEXT_PLATFORM_linux_x86_64) && defined(LIBCONTEXT_COMPILER_gcc)
+__asm (
+".text\n"
+".globl make_fcontext\n"
+".type make_fcontext,@function\n"
+".align 16\n"
+"make_fcontext:\n"
+"    movq  %rdi, %rax\n"
+"    andq  $-16, %rax\n"
+"    leaq  -0x48(%rax), %rax\n"
+"    movq  %rdx, 0x38(%rax)\n"
+"    stmxcsr  (%rax)\n"
+"    fnstcw   0x4(%rax)\n"
+"    leaq  finish(%rip), %rcx\n"
+"    movq  %rcx, 0x40(%rax)\n"
+"    ret \n"
+"finish:\n"
+"    xorq  %rdi, %rdi\n"
+"    call  _exit@PLT\n"
+"    hlt\n"
+".size make_fcontext,.-make_fcontext\n"
+".section .note.GNU-stack,\"\",%progbits\n"
+);
+
+#endif
+
+#if defined(LIBCONTEXT_PLATFORM_apple_x86_64) && defined(LIBCONTEXT_COMPILER_gcc)
+__asm (
+".text\n"
+".globl _jump_fcontext\n"
+".align 8\n"
+"_jump_fcontext:\n"
+"    pushq  %rbp  \n"
+"    pushq  %rbx  \n"
+"    pushq  %r15  \n"
+"    pushq  %r14  \n"
+"    pushq  %r13  \n"
+"    pushq  %r12  \n"
+"    leaq  -0x8(%rsp), %rsp\n"
+"    cmp  $0, %rcx\n"
+"    je  1f\n"
+"    stmxcsr  (%rsp)\n"
+"    fnstcw   0x4(%rsp)\n"
+"1:\n"
+"    movq  %rsp, (%rdi)\n"
+"    movq  %rsi, %rsp\n"
+"    cmp  $0, %rcx\n"
+"    je  2f\n"
+"    ldmxcsr  (%rsp)\n"
+"    fldcw  0x4(%rsp)\n"
+"2:\n"
+"    leaq  0x8(%rsp), %rsp\n"
+"    popq  %r12  \n"
+"    popq  %r13  \n"
+"    popq  %r14  \n"
+"    popq  %r15  \n"
+"    popq  %rbx  \n"
+"    popq  %rbp  \n"
+"    popq  %r8\n"
+"    movq  %rdx, %rax\n"
+"    movq  %rdx, %rdi\n"
+"    jmp  *%r8\n"
+);
+
+#endif
+
+#if defined(LIBCONTEXT_PLATFORM_apple_x86_64) && defined(LIBCONTEXT_COMPILER_gcc)
+__asm (
+".text\n"
+".globl _make_fcontext\n"
+".align 8\n"
+"_make_fcontext:\n"
+"    movq  %rdi, %rax\n"
+"    movabs  $-16,           %r8\n"
+"    andq    %r8,            %rax\n"
+"    leaq  -0x48(%rax), %rax\n"
+"    movq  %rdx, 0x38(%rax)\n"
+"    stmxcsr  (%rax)\n"
+"    fnstcw   0x4(%rax)\n"
+"    leaq  finish(%rip), %rcx\n"
+"    movq  %rcx, 0x40(%rax)\n"
+"    ret \n"
+"finish:\n"
+"    xorq  %rdi, %rdi\n"
+"    call  __exit\n"
+"    hlt\n"
+);
+
+#endif
+
+#if defined(LIBCONTEXT_PLATFORM_apple_i386) && defined(LIBCONTEXT_COMPILER_gcc)
+__asm (
+".text\n"
+".globl _jump_fcontext\n"
+".align 2\n"
+"_jump_fcontext:\n"
+"    movl  0x10(%esp), %ecx\n"
+"    pushl  %ebp  \n"
+"    pushl  %ebx  \n"
+"    pushl  %esi  \n"
+"    pushl  %edi  \n"
+"    leal  -0x8(%esp), %esp\n"
+"    test  %ecx, %ecx\n"
+"    je  1f\n"
+"    stmxcsr  (%esp)\n"
+"    fnstcw  0x4(%esp)\n"
+"1:\n"
+"    movl  0x1c(%esp), %eax\n"
+"    movl  %esp, (%eax)\n"
+"    movl  0x20(%esp), %edx\n"
+"    movl  0x24(%esp), %eax\n"
+"    movl  %edx, %esp\n"
+"    test  %ecx, %ecx\n"
+"    je  2f\n"
+"    ldmxcsr  (%esp)\n"
+"    fldcw  0x4(%esp)\n"
+"2:\n"
+"    leal  0x8(%esp), %esp\n"
+"    popl  %edi  \n"
+"    popl  %esi  \n"
+"    popl  %ebx  \n"
+"    popl  %ebp  \n"
+"    popl  %edx\n"
+"    movl  %eax, 0x4(%esp)\n"
+"    jmp  *%edx\n"
+);
+
+#endif
+
+#if defined(LIBCONTEXT_PLATFORM_apple_i386) && defined(LIBCONTEXT_COMPILER_gcc)
+__asm (
+".text\n"
+".globl _make_fcontext\n"
+".align 2\n"
+"_make_fcontext:\n"
+"    movl  0x4(%esp), %eax\n"
+"    leal  -0x8(%eax), %eax\n"
+"    andl  $-16, %eax\n"
+"    leal  -0x20(%eax), %eax\n"
+"    movl  0xc(%esp), %edx\n"
+"    movl  %edx, 0x18(%eax)\n"
+"    stmxcsr  (%eax)\n"
+"    fnstcw  0x4(%eax)\n"
+"    call  1f\n"
+"1:  popl  %ecx\n"
+"    addl  $finish-1b, %ecx\n"
+"    movl  %ecx, 0x1c(%eax)\n"
+"    ret \n"
+"finish:\n"
+"    xorl  %eax, %eax\n"
+"    movl  %eax, (%esp)\n"
+"    call  __exit\n"
+"    hlt\n"
+);
+
+#endif
+
+#if defined(LIBCONTEXT_PLATFORM_linux_arm32) && defined(LIBCONTEXT_COMPILER_gcc)
+__asm (
+".text\n"
+".globl jump_fcontext\n"
+".align 2\n"
+".type jump_fcontext,%function\n"
+"jump_fcontext:\n"
+"    @ save LR as PC\n"
+"    push {lr}\n"
+"    @ save V1-V8,LR\n"
+"    push {v1-v8,lr}\n"
+"    @ prepare stack for FPU\n"
+"    sub  sp, sp, #64\n"
+"    @ test if fpu env should be preserved\n"
+"    cmp  a4, #0\n"
+"    beq  1f\n"
+"    @ save S16-S31\n"
+"    vstmia  sp, {d8-d15}\n"
+"1:\n"
+"    @ store RSP (pointing to context-data) in A1\n"
+"    str  sp, [a1]\n"
+"    @ restore RSP (pointing to context-data) from A2\n"
+"    mov  sp, a2\n"
+"    @ test if fpu env should be preserved\n"
+"    cmp  a4, #0\n"
+"    beq  2f\n"
+"    @ restore S16-S31\n"
+"    vldmia  sp, {d8-d15}\n"
+"2:\n"
+"    @ prepare stack for FPU\n"
+"    add  sp, sp, #64\n"
+"    @ use third arg as return value after jump\n"
+"    @ and as first arg in context function\n"
+"    mov  a1, a3\n"
+"    @ restore v1-V8,LR,PC\n"
+"    pop {v1-v8,lr}\n"
+"    pop {pc}\n"
+".size jump_fcontext,.-jump_fcontext\n"
+"@ Mark that we don't need executable stack.\n"
+".section .note.GNU-stack,\"\",%progbits\n"
+);
+
+#endif
+
+#if defined(LIBCONTEXT_PLATFORM_linux_arm32) && defined(LIBCONTEXT_COMPILER_gcc)
+__asm (
+".text\n"
+".globl make_fcontext\n"
+".align 2\n"
+".type make_fcontext,%function\n"
+"make_fcontext:\n"
+"    @ shift address in A1 to lower 16 byte boundary\n"
+"    bic  a1, a1, #15\n"
+"    @ reserve space for context-data on context-stack\n"
+"    sub  a1, a1, #104\n"
+"    @ third arg of make_fcontext() == address of context-function\n"
+"    str  a3, [a1,#100]\n"
+"    @ compute abs address of label finish\n"
+"    adr  a2, finish\n"
+"    @ save address of finish as return-address for context-function\n"
+"    @ will be entered after context-function returns\n"
+"    str  a2, [a1,#96]\n"
+"    bx  lr @ return pointer to context-data\n"
+"finish:\n"
+"    @ exit code is zero\n"
+"    mov  a1, #0\n"
+"    @ exit application\n"
+"    bl  _exit@PLT\n"
+".size make_fcontext,.-make_fcontext\n"
+"@ Mark that we don't need executable stack.\n"
+".section .note.GNU-stack,\"\",%progbits\n"
+);
+
+#endif
+
+#if defined(LIBCONTEXT_PLATFORM_linux_arm64) && defined(LIBCONTEXT_COMPILER_gcc)
+__asm (
+".cpu    generic+fp+simd\n"
+".text\n"
+".align  2\n"
+".global jump_fcontext\n"
+".type   jump_fcontext, %function\n"
+"jump_fcontext:\n"
+"    # prepare stack for GP + FPU\n"
+"    sub  sp, sp, #0xb0\n"
+"# Because gcc may save integer registers in fp registers across a\n"
+"# function call we cannot skip saving the fp registers.\n"
+"#\n"
+"# Do not reinstate this test unless you fully understand what you\n"
+"# are doing.\n"
+"#\n"
+"#    # test if fpu env should be preserved\n"
+"#    cmp  w3, #0\n"
+"#    b.eq  1f\n"
+"    # save d8 - d15\n"
+"    stp  d8,  d9,  [sp, #0x00]\n"
+"    stp  d10, d11, [sp, #0x10]\n"
+"    stp  d12, d13, [sp, #0x20]\n"
+"    stp  d14, d15, [sp, #0x30]\n"
+"1:\n"
+"    # save x19-x30\n"
+"    stp  x19, x20, [sp, #0x40]\n"
+"    stp  x21, x22, [sp, #0x50]\n"
+"    stp  x23, x24, [sp, #0x60]\n"
+"    stp  x25, x26, [sp, #0x70]\n"
+"    stp  x27, x28, [sp, #0x80]\n"
+"    stp  x29, x30, [sp, #0x90]\n"
+"    # save LR as PC\n"
+"    str  x30, [sp, #0xa0]\n"
+"    # store RSP (pointing to context-data) in first argument (x0).\n"
+"    # STR cannot have sp as a target register\n"
+"    mov  x4, sp\n"
+"    str  x4, [x0]\n"
+"    # restore RSP (pointing to context-data) from A2 (x1)\n"
+"    mov  sp, x1\n"
+"#    # test if fpu env should be preserved\n"
+"#    cmp  w3, #0\n"
+"#    b.eq  2f\n"
+"    # load d8 - d15\n"
+"    ldp  d8,  d9,  [sp, #0x00]\n"
+"    ldp  d10, d11, [sp, #0x10]\n"
+"    ldp  d12, d13, [sp, #0x20]\n"
+"    ldp  d14, d15, [sp, #0x30]\n"
+"2:\n"
+"    # load x19-x30\n"
+"    ldp  x19, x20, [sp, #0x40]\n"
+"    ldp  x21, x22, [sp, #0x50]\n"
+"    ldp  x23, x24, [sp, #0x60]\n"
+"    ldp  x25, x26, [sp, #0x70]\n"
+"    ldp  x27, x28, [sp, #0x80]\n"
+"    ldp  x29, x30, [sp, #0x90]\n"
+"    # use third arg as return value after jump\n"
+"    # and as first arg in context function\n"
+"    mov  x0, x2\n"
+"    # load pc\n"
+"    ldr  x4, [sp, #0xa0]\n"
+"    # restore stack from GP + FPU\n"
+"    add  sp, sp, #0xb0\n"
+"    ret x4\n"
+".size   jump_fcontext,.-jump_fcontext\n"
+"# Mark that we don't need executable stack.\n"
+".section .note.GNU-stack,\"\",%progbits\n"
+);
+
+#endif
+
+#if defined(LIBCONTEXT_PLATFORM_linux_arm64) && defined(LIBCONTEXT_COMPILER_gcc)
+__asm (
+".cpu    generic+fp+simd\n"
+".text\n"
+".align  2\n"
+".global make_fcontext\n"
+".type   make_fcontext, %function\n"
+"make_fcontext:\n"
+"    # shift address in x0 (allocated stack) to lower 16 byte boundary\n"
+"    and x0, x0, ~0xF\n"
+"    # reserve space for context-data on context-stack\n"
+"    sub  x0, x0, #0xb0\n"
+"    # third arg of make_fcontext() == address of context-function\n"
+"    # store address as a PC to jump in\n"
+"    str  x2, [x0, #0xa0]\n"
+"    # save address of finish as return-address for context-function\n"
+"    # will be entered after context-function returns (LR register)\n"
+"    adr  x1, finish\n"
+"    str  x1, [x0, #0x98]\n"
+"    ret  x30 \n"
+"finish:\n"
+"    # exit code is zero\n"
+"    mov  x0, #0\n"
+"    # exit application\n"
+"    bl  _exit\n"
+".size   make_fcontext,.-make_fcontext\n"
+"# Mark that we don't need executable stack.\n"
+".section .note.GNU-stack,\"\",%progbits\n"
+);
+
+#endif
+
+#if defined(LIBCONTEXT_PLATFORM_linux_mips_n64) && defined(LIBCONTEXT_COMPILER_gcc)
+__asm (
+".text\n"
+".globl jump_fcontext\n"
+".align 2\n"
+".set noreorder\n"
+".type jump_fcontext,@function\n"
+".ent jump_fcontext\n"
+"jump_fcontext:\n"
+"    # reserve space on stack\n"
+"    daddiu $sp, $sp, -176\n"
+"    sd  $s0, 64($sp)  # save S0\n"
+"    sd  $s1, 72($sp)  # save S1\n"
+"    sd  $s2, 80($sp)  # save S2\n"
+"    sd  $s3, 88($sp)  # save S3\n"
+"    sd  $s4, 96($sp)  # save S4\n"
+"    sd  $s5, 104($sp) # save S5\n"
+"    sd  $s6, 112($sp) # save S6\n"
+"    sd  $s7, 120($sp) # save S7\n"
+"    sd  $fp, 128($sp) # save FP\n"
+"    sd  $ra, 144($sp) # save RA\n"
+"    sd  $ra, 152($sp) # save RA as PC\n"
+"    s.d  $f24, 0($sp)   # save F24\n"
+"    s.d  $f25, 8($sp)   # save F25\n"
+"    s.d  $f26, 16($sp)  # save F26\n"
+"    s.d  $f27, 24($sp)  # save F27\n"
+"    s.d  $f28, 32($sp)  # save F28\n"
+"    s.d  $f29, 40($sp)  # save F29\n"
+"    s.d  $f30, 48($sp)  # save F30\n"
+"    s.d  $f31, 56($sp)  # save F31\n"
+"    # store SP (pointing to old context-data) in pointer a0(first arg)\n"
+"    sd  $sp, 0($a0)\n"
+"    # get SP (pointing to new context-data) from a1 param\n"
+"    move  $sp, $a1\n"
+"    l.d  $f24, 0($sp)   # restore F24\n"
+"    l.d  $f25, 8($sp)   # restore F25\n"
+"    l.d  $f26, 16($sp)  # restore F26\n"
+"    l.d  $f27, 24($sp)  # restore F27\n"
+"    l.d  $f28, 32($sp)  # restore F28\n"
+"    l.d  $f29, 40($sp)  # restore F29\n"
+"    l.d  $f30, 48($sp)  # restore F30\n"
+"    l.d  $f31, 56($sp)  # restore F31\n"
+"    ld  $s0, 64($sp)  # restore S0\n"
+"    ld  $s1, 72($sp)  # restore S1\n"
+"    ld  $s2, 80($sp)  # restore S2\n"
+"    ld  $s3, 88($sp)  # restore S3\n"
+"    ld  $s4, 96($sp)  # restore S4\n"
+"    ld  $s5, 104($sp) # restore S5\n"
+"    ld  $s6, 112($sp) # restore S6\n"
+"    ld  $s7, 120($sp) # restore S7\n"
+"    ld  $fp, 128($sp) # restore FP\n"
+"    ld  $ra, 144($sp) # restore RA\n"
+"    # load PC\n"
+"    ld  $t9, 152($sp)\n"
+"    sd  $a2, 160($sp)\n"
+"    # adjust stack\n"
+"    daddiu $sp, $sp, 176\n"
+"    move  $a0, $a2 # move *data from a2 to a0 as param\n"
+"    move  $v0, $a2 # move *data from a2 to v0 as return\n"
+"    # jump to context\n"
+"    jr  $t9\n"
+"    nop\n"
+".end jump_fcontext\n"
+".size jump_fcontext, .-jump_fcontext\n"
+".section .note.GNU-stack,\"\",%progbits\n"
+);
+
+#endif
+
+#if defined(LIBCONTEXT_PLATFORM_linux_mips_n64) && defined(LIBCONTEXT_COMPILER_gcc)
+__asm (
+".text\n"
+".globl make_fcontext\n"
+".align 2\n"
+".set noreorder\n"
+".type make_fcontext,@function\n"
+".ent make_fcontext\n"
+"make_fcontext:\n"
+"#ifdef __PIC__\n"
+".set    noreorder\n"
+".cpload $t9\n"
+".set    reorder\n"
+"#endif\n"
+"    # shift address in A0 to lower 16 byte boundary\n"
+"    li $v1, 0xfffffffffffffff0\n"
+"    and $v0, $v1, $a0\n"
+"    # reserve space for context-data on context-stack\n"
+"    daddiu $v0, $v0, -176\n"
+"    # third arg of make_fcontext() == address of context-function\n"
+"    sd  $a2, 152($v0)\n"
+"    # save global pointer in context-data\n"
+"    sd  $gp, 136($v0)\n"
+"    # psudo instruction compute abs address of label finish based on GP\n"
+"    dla  $t9, finish\n"
+"    # save address of finish as return-address for context-function\n"
+"    # will be entered after context-function returns\n"
+"    sd  $t9, 144($v0)\n"
+"    jr  $ra # return pointer to context-data\n"
+"    nop\n"
+"finish:\n"
+"    # reload our gp register (needed for la)\n"
+"    daddiu $t0, $sp, -176\n"
+"    ld $gp, 136($t0)\n"
+"    ld $v0, 160($t0)\n"
+"    # call _exit(0)\n"
+"    dla $t9, _exit\n"
+"    move $a0, $zero\n"
+"    jr $t9\n"
+"    nop\n"
+".end make_fcontext\n"
+".size make_fcontext, .-make_fcontext\n"
+".section .note.GNU-stack,\"\",%progbits\n"
+);
+
+#endif
+
+#if defined(LIBCONTEXT_PLATFORM_linux_ppc32) && defined(LIBCONTEXT_COMPILER_gcc)
+__asm (
+".text\n"
+".globl jump_fcontext\n"
+".align 2\n"
+".type jump_fcontext,@function\n"
+"jump_fcontext:\n"
+"    # reserve space on stack\n"
+"    subi  %r1, %r1, 240\n"
+"    stw  %r13, 152(%r1)  # save R13\n"
+"    stw  %r14, 156(%r1)  # save R14\n"
+"    stw  %r15, 160(%r1)  # save R15\n"
+"    stw  %r16, 164(%r1)  # save R16\n"
+"    stw  %r17, 168(%r1)  # save R17\n"
+"    stw  %r18, 172(%r1)  # save R18\n"
+"    stw  %r19, 176(%r1)  # save R19\n"
+"    stw  %r20, 180(%r1)  # save R20\n"
+"    stw  %r21, 184(%r1)  # save R21\n"
+"    stw  %r22, 188(%r1)  # save R22\n"
+"    stw  %r23, 192(%r1)  # save R23\n"
+"    stw  %r24, 196(%r1)  # save R24\n"
+"    stw  %r25, 200(%r1)  # save R25\n"
+"    stw  %r26, 204(%r1)  # save R26\n"
+"    stw  %r27, 208(%r1)  # save R27\n"
+"    stw  %r28, 212(%r1)  # save R28\n"
+"    stw  %r29, 216(%r1)  # save R29\n"
+"    stw  %r30, 220(%r1)  # save R30\n"
+"    stw  %r31, 224(%r1)  # save R31\n"
+"    # save CR\n"
+"    mfcr  %r0\n"
+"    stw  %r0, 228(%r1)\n"
+"    # save LR\n"
+"    mflr  %r0\n"
+"    stw  %r0, 232(%r1)\n"
+"    # save LR as PC\n"
+"    stw  %r0, 236(%r1)\n"
+"    # test if fpu env should be preserved\n"
+"    cmpwi  cr7, %r6, 0\n"
+"    beq  cr7, 1f\n"
+"    stfd  %f14, 0(%r1)  # save F14\n"
+"    stfd  %f15, 8(%r1)  # save F15\n"
+"    stfd  %f16, 16(%r1)  # save F16\n"
+"    stfd  %f17, 24(%r1)  # save F17\n"
+"    stfd  %f18, 32(%r1)  # save F18\n"
+"    stfd  %f19, 40(%r1)  # save F19\n"
+"    stfd  %f20, 48(%r1)  # save F20\n"
+"    stfd  %f21, 56(%r1)  # save F21\n"
+"    stfd  %f22, 64(%r1)  # save F22\n"
+"    stfd  %f23, 72(%r1)  # save F23\n"
+"    stfd  %f24, 80(%r1)  # save F24\n"
+"    stfd  %f25, 88(%r1)  # save F25\n"
+"    stfd  %f26, 96(%r1)  # save F26\n"
+"    stfd  %f27, 104(%r1)  # save F27\n"
+"    stfd  %f28, 112(%r1)  # save F28\n"
+"    stfd  %f29, 120(%r1)  # save F29\n"
+"    stfd  %f30, 128(%r1)  # save F30\n"
+"    stfd  %f31, 136(%r1)  # save F31\n"
+"    mffs  %f0  # load FPSCR\n"
+"    stfd  %f0, 144(%r1)  # save FPSCR\n"
+"1:\n"
+"    # store RSP (pointing to context-data) in R3\n"
+"    stw  %r1, 0(%r3)\n"
+"    # restore RSP (pointing to context-data) from R4\n"
+"    mr  %r1, %r4\n"
+"    # test if fpu env should be preserved\n"
+"    cmpwi  cr7, %r6, 0\n"
+"    beq  cr7, 2f\n"
+"    lfd  %f14, 0(%r1)  # restore F14\n"
+"    lfd  %f15, 8(%r1)  # restore F15\n"
+"    lfd  %f16, 16(%r1)  # restore F16\n"
+"    lfd  %f17, 24(%r1)  # restore F17\n"
+"    lfd  %f18, 32(%r1)  # restore F18\n"
+"    lfd  %f19, 40(%r1)  # restore F19\n"
+"    lfd  %f20, 48(%r1)  # restore F20\n"
+"    lfd  %f21, 56(%r1)  # restore F21\n"
+"    lfd  %f22, 64(%r1)  # restore F22\n"
+"    lfd  %f23, 72(%r1)  # restore F23\n"
+"    lfd  %f24, 80(%r1)  # restore F24\n"
+"    lfd  %f25, 88(%r1)  # restore F25\n"
+"    lfd  %f26, 96(%r1)  # restore F26\n"
+"    lfd  %f27, 104(%r1)  # restore F27\n"
+"    lfd  %f28, 112(%r1)  # restore F28\n"
+"    lfd  %f29, 120(%r1)  # restore F29\n"
+"    lfd  %f30, 128(%r1)  # restore F30\n"
+"    lfd  %f31, 136(%r1)  # restore F31\n"
+"    lfd  %f0,  144(%r1)  # load FPSCR\n"
+"    mtfsf  0xff, %f0  # restore FPSCR\n"
+"2:\n"
+"    lwz  %r13, 152(%r1)  # restore R13\n"
+"    lwz  %r14, 156(%r1)  # restore R14\n"
+"    lwz  %r15, 160(%r1)  # restore R15\n"
+"    lwz  %r16, 164(%r1)  # restore R16\n"
+"    lwz  %r17, 168(%r1)  # restore R17\n"
+"    lwz  %r18, 172(%r1)  # restore R18\n"
+"    lwz  %r19, 176(%r1)  # restore R19\n"
+"    lwz  %r20, 180(%r1)  # restore R20\n"
+"    lwz  %r21, 184(%r1)  # restore R21\n"
+"    lwz  %r22, 188(%r1)  # restore R22\n"
+"    lwz  %r23, 192(%r1)  # restore R23\n"
+"    lwz  %r24, 196(%r1)  # restore R24\n"
+"    lwz  %r25, 200(%r1)  # restore R25\n"
+"    lwz  %r26, 204(%r1)  # restore R26\n"
+"    lwz  %r27, 208(%r1)  # restore R27\n"
+"    lwz  %r28, 212(%r1)  # restore R28\n"
+"    lwz  %r29, 216(%r1)  # restore R29\n"
+"    lwz  %r30, 220(%r1)  # restore R30\n"
+"    lwz  %r31, 224(%r1)  # restore R31\n"
+"    # restore CR\n"
+"    lwz  %r0, 228(%r1)\n"
+"    mtcr  %r0\n"
+"    # restore LR\n"
+"    lwz  %r0, 232(%r1)\n"
+"    mtlr  %r0\n"
+"    # load PC\n"
+"    lwz  %r0, 236(%r1)\n"
+"    # restore CTR\n"
+"    mtctr  %r0\n"
+"    # adjust stack\n"
+"    addi  %r1, %r1, 240\n"
+"    # use third arg as return value after jump\n"
+"    # use third arg as first arg in context function\n"
+"    mr  %r3, %r5\n"
+"    # jump to context\n"
+"    bctr\n"
+".size jump_fcontext, .-jump_fcontext\n"
+".section .note.GNU-stack,\"\",%progbits\n"
+);
+
+#endif
+
+#if defined(LIBCONTEXT_PLATFORM_linux_ppc32) && defined(LIBCONTEXT_COMPILER_gcc)
+__asm (
+".text\n"
+".globl make_fcontext\n"
+".align 2\n"
+".type make_fcontext,@function\n"
+"make_fcontext:\n"
+"    # save return address into R6\n"
+"    mflr  %r6\n"
+"    # first arg of make_fcontext() == top address of context-function\n"
+"    # shift address in R3 to lower 16 byte boundary\n"
+"    clrrwi  %r3, %r3, 4\n"
+"    # reserve space for context-data on context-stack\n"
+"    # including 64 byte of linkage + parameter area (R1 % 16 == 0)\n"
+"    subi  %r3, %r3, 304\n"
+"    # third arg of make_fcontext() == address of context-function\n"
+"    stw  %r5, 236(%r3)\n"
+"    # load LR\n"
+"    mflr  %r0\n"
+"    # jump to label 1\n"
+"    bl  1f\n"
+"1:\n"
+"    # load LR into R4\n"
+"    mflr  %r4\n"
+"    # compute abs address of label finish\n"
+"    addi  %r4, %r4, finish - 1b\n"
+"    # restore LR\n"
+"    mtlr  %r0\n"
+"    # save address of finish as return-address for context-function\n"
+"    # will be entered after context-function returns\n"
+"    stw  %r4, 232(%r3)\n"
+"    # restore return address from R6\n"
+"    mtlr  %r6\n"
+"    blr  # return pointer to context-data\n"
+"finish:\n"
+"    # save return address into R0\n"
+"    mflr  %r0\n"
+"    # save return address on stack, set up stack frame\n"
+"    stw  %r0, 4(%r1)\n"
+"    # allocate stack space, R1 % 16 == 0\n"
+"    stwu  %r1, -16(%r1)\n"
+"    # exit code is zero\n"
+"    li  %r3, 0\n"
+"    # exit application\n"
+"    bl  _exit@plt\n"
+".size make_fcontext, .-make_fcontext\n"
+".section .note.GNU-stack,\"\",%progbits\n"
+);
+
+#endif
+
+#if defined(LIBCONTEXT_PLATFORM_linux_ppc64) && defined(LIBCONTEXT_COMPILER_gcc)
+__asm (
+".globl jump_fcontext\n"
+#if _CALL_ELF == 2
+"  .text\n"
+"  .align 2\n"
+"jump_fcontext:\n"
+"        addis   %r2, %r12, .TOC.-jump_fcontext@ha\n"
+"        addi    %r2, %r2, .TOC.-jump_fcontext@l\n"
+"        .localentry jump_fcontext, . - jump_fcontext\n"
+#else
+"  .section \".opd\",\"aw\"\n"
+"  .align 3\n"
+"jump_fcontext:\n"
+# ifdef _CALL_LINUX
+"        .quad   .L.jump_fcontext,.TOC.@tocbase,0\n"
+"        .type   jump_fcontext,@function\n"
+"        .text\n"
+"        .align 2\n"
+".L.jump_fcontext:\n"
+# else
+"        .hidden .jump_fcontext\n"
+"        .globl  .jump_fcontext\n"
+"        .quad   .jump_fcontext,.TOC.@tocbase,0\n"
+"        .size   jump_fcontext,24\n"
+"        .type   .jump_fcontext,@function\n"
+"        .text\n"
+"        .align 2\n"
+".jump_fcontext:\n"
+# endif
+#endif
+"    # reserve space on stack\n"
+"    subi  %r1, %r1, 328\n"
+#if _CALL_ELF != 2
+"    std  %r2,  152(%r1)  # save TOC\n"
+#endif
+"    std  %r14, 160(%r1)  # save R14\n"
+"    std  %r15, 168(%r1)  # save R15\n"
+"    std  %r16, 176(%r1)  # save R16\n"
+"    std  %r17, 184(%r1)  # save R17\n"
+"    std  %r18, 192(%r1)  # save R18\n"
+"    std  %r19, 200(%r1)  # save R19\n"
+"    std  %r20, 208(%r1)  # save R20\n"
+"    std  %r21, 216(%r1)  # save R21\n"
+"    std  %r22, 224(%r1)  # save R22\n"
+"    std  %r23, 232(%r1)  # save R23\n"
+"    std  %r24, 240(%r1)  # save R24\n"
+"    std  %r25, 248(%r1)  # save R25\n"
+"    std  %r26, 256(%r1)  # save R26\n"
+"    std  %r27, 264(%r1)  # save R27\n"
+"    std  %r28, 272(%r1)  # save R28\n"
+"    std  %r29, 280(%r1)  # save R29\n"
+"    std  %r30, 288(%r1)  # save R30\n"
+"    std  %r31, 296(%r1)  # save R31\n"
+"    # save CR\n"
+"    mfcr  %r0\n"
+"    std  %r0, 304(%r1)\n"
+"    # save LR\n"
+"    mflr  %r0\n"
+"    std  %r0, 312(%r1)\n"
+"    # save LR as PC\n"
+"    std  %r0, 320(%r1)\n"
+"    # test if fpu env should be preserved\n"
+"    cmpwi  cr7, %r6, 0\n"
+"    beq  cr7, 1f\n"
+"    stfd  %f14, 0(%r1)  # save F14\n"
+"    stfd  %f15, 8(%r1)  # save F15\n"
+"    stfd  %f16, 16(%r1)  # save F16\n"
+"    stfd  %f17, 24(%r1)  # save F17\n"
+"    stfd  %f18, 32(%r1)  # save F18\n"
+"    stfd  %f19, 40(%r1)  # save F19\n"
+"    stfd  %f20, 48(%r1)  # save F20\n"
+"    stfd  %f21, 56(%r1)  # save F21\n"
+"    stfd  %f22, 64(%r1)  # save F22\n"
+"    stfd  %f23, 72(%r1)  # save F23\n"
+"    stfd  %f24, 80(%r1)  # save F24\n"
+"    stfd  %f25, 88(%r1)  # save F25\n"
+"    stfd  %f26, 96(%r1)  # save F26\n"
+"    stfd  %f27, 104(%r1)  # save F27\n"
+"    stfd  %f28, 112(%r1)  # save F28\n"
+"    stfd  %f29, 120(%r1)  # save F29\n"
+"    stfd  %f30, 128(%r1)  # save F30\n"
+"    stfd  %f31, 136(%r1)  # save F31\n"
+"    mffs  %f0  # load FPSCR\n"
+"    stfd  %f0, 144(%r1)  # save FPSCR\n"
+"1:\n"
+"    # store RSP (pointing to context-data) in R3\n"
+"    std  %r1, 0(%r3)\n"
+"    # restore RSP (pointing to context-data) from R4\n"
+"    mr  %r1, %r4\n"
+"    # test if fpu env should be preserved\n"
+"    cmpwi  cr7, %r6, 0\n"
+"    beq  cr7, 2f\n"
+"    lfd  %f14, 0(%r1)  # restore F14\n"
+"    lfd  %f15, 8(%r1)  # restore F15\n"
+"    lfd  %f16, 16(%r1)  # restore F16\n"
+"    lfd  %f17, 24(%r1)  # restore F17\n"
+"    lfd  %f18, 32(%r1)  # restore F18\n"
+"    lfd  %f19, 40(%r1)  # restore F19\n"
+"    lfd  %f20, 48(%r1)  # restore F20\n"
+"    lfd  %f21, 56(%r1)  # restore F21\n"
+"    lfd  %f22, 64(%r1)  # restore F22\n"
+"    lfd  %f23, 72(%r1)  # restore F23\n"
+"    lfd  %f24, 80(%r1)  # restore F24\n"
+"    lfd  %f25, 88(%r1)  # restore F25\n"
+"    lfd  %f26, 96(%r1)  # restore F26\n"
+"    lfd  %f27, 104(%r1)  # restore F27\n"
+"    lfd  %f28, 112(%r1)  # restore F28\n"
+"    lfd  %f29, 120(%r1)  # restore F29\n"
+"    lfd  %f30, 128(%r1)  # restore F30\n"
+"    lfd  %f31, 136(%r1)  # restore F31\n"
+"    lfd  %f0,  144(%r1)  # load FPSCR\n"
+"    mtfsf  0xff, %f0  # restore FPSCR\n"
+"2:\n"
+#if _CALL_ELF != 2
+"    ld  %r2,  152(%r1)  # restore TOC\n"
+#endif
+"    ld  %r14, 160(%r1)  # restore R14\n"
+"    ld  %r15, 168(%r1)  # restore R15\n"
+"    ld  %r16, 176(%r1)  # restore R16\n"
+"    ld  %r17, 184(%r1)  # restore R17\n"
+"    ld  %r18, 192(%r1)  # restore R18\n"
+"    ld  %r19, 200(%r1)  # restore R19\n"
+"    ld  %r20, 208(%r1)  # restore R20\n"
+"    ld  %r21, 216(%r1)  # restore R21\n"
+"    ld  %r22, 224(%r1)  # restore R22\n"
+"    ld  %r23, 232(%r1)  # restore R23\n"
+"    ld  %r24, 240(%r1)  # restore R24\n"
+"    ld  %r25, 248(%r1)  # restore R25\n"
+"    ld  %r26, 256(%r1)  # restore R26\n"
+"    ld  %r27, 264(%r1)  # restore R27\n"
+"    ld  %r28, 272(%r1)  # restore R28\n"
+"    ld  %r29, 280(%r1)  # restore R29\n"
+"    ld  %r30, 288(%r1)  # restore R30\n"
+"    ld  %r31, 296(%r1)  # restore R31\n"
+"    # restore CR\n"
+"    ld  %r0, 304(%r1)\n"
+"    mtcr  %r0\n"
+"    # restore LR\n"
+"    ld  %r0, 312(%r1)\n"
+"    mtlr  %r0\n"
+"    # load PC\n"
+"    ld  %r12, 320(%r1)\n"
+"    # restore CTR\n"
+"    mtctr  %r12\n"
+"    # adjust stack\n"
+"    addi  %r1, %r1, 328\n"
+"    # use third arg as return value after jump\n"
+"    # use third arg as first arg in context function\n"
+"    mr  %r3, %r5\n"
+"    # jump to context\n"
+"    bctr\n"
+#if _CALL_ELF == 2
+"  .size jump_fcontext, .-jump_fcontext\n"
+#else
+# ifdef _CALL_LINUX
+"  .size .jump_fcontext, .-.L.jump_fcontext\n"
+# else
+"  .size .jump_fcontext, .-.jump_fcontext\n"
+# endif
+#endif
+".section .note.GNU-stack,\"\",%progbits\n"
+);
+
+#endif
+
+#if defined(LIBCONTEXT_PLATFORM_linux_ppc64) && defined(LIBCONTEXT_COMPILER_gcc)
+__asm (
+".globl make_fcontext\n"
+#if _CALL_ELF == 2
+"  .text\n"
+"  .align 2\n"
+"make_fcontext:\n"
+"  addis   %r2, %r12, .TOC.-make_fcontext@ha\n"
+"  addi    %r2, %r2, .TOC.-make_fcontext@l\n"
+"  .localentry make_fcontext, . - make_fcontext\n"
+#else
+"  .section \".opd\",\"aw\"\n"
+"  .align 3\n"
+"make_fcontext:\n"
+# ifdef _CALL_LINUX
+"  .quad   .L.make_fcontext,.TOC.@tocbase,0\n"
+"  .type   make_fcontext,@function\n"
+"  .text\n"
+"  .align 2\n"
+".L.make_fcontext:\n"
+# else
+"  .hidden .make_fcontext\n"
+"  .globl  .make_fcontext\n"
+"  .quad   .make_fcontext,.TOC.@tocbase,0\n"
+"  .size   make_fcontext,24\n"
+"  .type   .make_fcontext,@function\n"
+"  .text\n"
+"  .align 2\n"
+".make_fcontext:\n"
+# endif
+#endif
+"    # save return address into R6\n"
+"    mflr  %r6\n"
+"    # first arg of make_fcontext() == top address of context-stack\n"
+"    # shift address in R3 to lower 16 byte boundary\n"
+"    clrrdi  %r3, %r3, 4\n"
+"    # reserve space for context-data on context-stack\n"
+"    # including 64 byte of linkage + parameter area (R1 % 16 == 0)\n"
+"    subi  %r3, %r3, 392\n"
+"    # third arg of make_fcontext() == address of context-function\n"
+"    # entry point (ELFv2) or descriptor (ELFv1)\n"
+#if _CALL_ELF == 2
+"    # save address of context-function entry point\n"
+"    std  %r5, 320(%r3)\n"
+#else
+"    # save address of context-function entry point\n"
+"    ld   %r4, 0(%r5)\n"
+"    std  %r4, 320(%r3)\n"
+"    # save TOC of context-function\n"
+"    ld   %r4, 8(%r5)\n"
+"    std  %r4, 152(%r3)\n"
+#endif
+"    # load LR\n"
+"    mflr  %r0\n"
+"    # jump to label 1\n"
+"    bl  1f\n"
+"1:\n"
+"    # load LR into R4\n"
+"    mflr  %r4\n"
+"    # compute abs address of label finish\n"
+"    addi  %r4, %r4, finish - 1b\n"
+"    # restore LR\n"
+"    mtlr  %r0\n"
+"    # save address of finish as return-address for context-function\n"
+"    # will be entered after context-function returns\n"
+"    std  %r4, 312(%r3)\n"
+"    # restore return address from R6\n"
+"    mtlr  %r6\n"
+"    blr  # return pointer to context-data\n"
+"finish:\n"
+"    # save return address into R0\n"
+"    mflr  %r0\n"
+"    # save return address on stack, set up stack frame\n"
+"    std  %r0, 8(%r1)\n"
+"    # allocate stack space, R1 % 16 == 0\n"
+"    stdu  %r1, -32(%r1)\n"
+"    # exit code is zero\n"
+"    li  %r3, 0\n"
+"    # exit application\n"
+"    bl  _exit\n"
+"    nop\n"
+#if _CALL_ELF == 2
+"  .size make_fcontext, .-make_fcontext\n"
+#else
+# ifdef _CALL_LINUX
+"  .size .make_fcontext, .-.L.make_fcontext\n"
+# else
+"  .size .make_fcontext, .-.make_fcontext\n"
+# endif
+#endif
+".section .note.GNU-stack,\"\",%progbits\n"
+);
+
+#endif
+
+#if defined(LIBCONTEXT_PLATFORM_msvc_x86_64) || defined(LIBCONTEXT_PLATFORM_msvc_i386)
+
+#include <map>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <windows.h>
+
+namespace libcontext
+{
+	
+static int threadHasFibers = 0;
+ 
+struct FiberData 
+{
+	intptr_t inValue;
+	intptr_t outValue;
+	void(*entry)(intptr_t);
+};
+
+static std::map<fcontext_t, FiberData> fiberParams;
+
+static void fiberEntry(LPVOID params)
+{
+	auto ctx = (fcontext_t) GetCurrentFiber();
+	auto& d = fiberParams[ctx];
+	d.entry(d.inValue);
+}
+
+fcontext_t LIBCONTEXT_CALL_CONVENTION make_fcontext(void* sp, size_t size, void(*fn)(intptr_t))
+{
+	if (!threadHasFibers)
+	{
+		ConvertThreadToFiber(nullptr);
+		threadHasFibers = 1;
+	}
+
+	fcontext_t ctx = CreateFiber(size, (LPFIBER_START_ROUTINE) fiberEntry, nullptr );
+	fiberParams[ctx].entry = fn;
+
+	return ctx;
+}
+
+intptr_t LIBCONTEXT_CALL_CONVENTION jump_fcontext(fcontext_t* ofc, fcontext_t nfc,
+	intptr_t vp, bool preserve_fpu)
+{
+	auto current = (void*)GetCurrentFiber();
+	fiberParams[current].outValue = vp;
+	*ofc = GetCurrentFiber();
+	fiberParams[nfc].inValue = vp;
+	SwitchToFiber(nfc);
+	return fiberParams[*ofc].outValue;
+}
+
+}; // namespace libcontext
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif
\ No newline at end of file
diff --git a/include/system/libcontext.h b/include/system/libcontext.h
index 8045fa2b7..cca91dcd8 100644
--- a/include/system/libcontext.h
+++ b/include/system/libcontext.h
@@ -24,9 +24,11 @@
 
 #if defined(__GNUC__) || defined(__APPLE__) || defined(__FreeBSD__)
 
+    #undef LIBCONTEXT_HAS_OWN_STACK
+
     #define LIBCONTEXT_COMPILER_gcc
 
-    #if defined(__linux__) || defined(__FreeBSD__)
+	#if defined(__linux__) || defined(__FreeBSD__)
     #if defined(__x86_64__) || defined(__amd64__)
         #define LIBCONTEXT_PLATFORM_linux_x86_64
         #define LIBCONTEXT_CALL_CONVENTION
@@ -46,7 +48,8 @@
         #ifdef _ARCH_PPC64
             #define LIBCONTEXT_PLATFORM_linux_ppc64
             #define LIBCONTEXT_CALL_CONVENTION
-        #elif defined _ARCH_PPC
+        #endif
+        #ifdef _ARCH_PPC
             #define LIBCONTEXT_PLATFORM_linux_ppc32
             #define LIBCONTEXT_CALL_CONVENTION
         #endif
@@ -73,6 +76,17 @@
         #define LIBCONTEXT_CALL_CONVENTION
     #endif
     #endif
+#elif defined (_MSC_VER)
+
+#define LIBCONTEXT_HAS_OWN_STACK
+
+#define LIBCONTEXT_CALL_CONVENTION __cdecl
+
+#if defined(_WIN64)
+	#define LIBCONTEXT_PLATFORM_msvc_x86_64
+#elif defined(_WIN32)
+	#define LIBCONTEXT_PLATFORM_msvc_i386
+#endif
 #endif
 
 #ifdef __cplusplus
@@ -83,13 +97,13 @@ namespace libcontext {
 typedef int intptr_t;
 #endif
 
+
 typedef void* fcontext_t;
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-
 intptr_t LIBCONTEXT_CALL_CONVENTION jump_fcontext( fcontext_t* ofc, fcontext_t nfc,
         intptr_t vp, bool preserve_fpu = true );
 fcontext_t LIBCONTEXT_CALL_CONVENTION make_fcontext( void* sp, size_t size,
diff --git a/include/tool/coroutine.h b/include/tool/coroutine.h
index 7be173adb..60144ebc0 100644
--- a/include/tool/coroutine.h
+++ b/include/tool/coroutine.h
@@ -294,15 +294,19 @@ private:
 
         assert( m_stack == nullptr );
 
-        // fixme: Clean up stack stuff. Add a guard
         size_t stackSize = c_defaultStackSize;
+        void* sp = nullptr;
+
+        #ifndef LIBCONTEXT_HAS_OWN_STACK
+        // fixme: Clean up stack stuff. Add a guard
         m_stack.reset( new char[stackSize] );
 
         // align to 16 bytes
-        void* sp = (void*)((((ptrdiff_t) m_stack.get()) + stackSize - 0xf) & (~0x0f));
+        sp = (void*)((((ptrdiff_t) m_stack.get()) + stackSize - 0xf) & (~0x0f));
 
         // correct the stack size
         stackSize -= size_t( ( (ptrdiff_t) m_stack.get() + stackSize ) - (ptrdiff_t) sp );
+        #endif
 
         m_callee = libcontext::make_fcontext( sp, stackSize, callerStub );
         m_running = true;
-- 
2.17.1


Follow ups