summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-01-21 10:59:18 +0100
committerAndreas Rumpf <rumpf_a@web.de>2018-01-21 10:59:18 +0100
commit81195fc3622bf540e783054923168371193de107 (patch)
tree9d198f79fb63517e55867ad9206f2d839500d731
parente5af08cc1244640ca57e2cf64dd1633b1f5fae46 (diff)
parentcdc54bec6f2d27753c1dd2f397ac003b2de67efb (diff)
downloadNim-81195fc3622bf540e783054923168371193de107.tar.gz
Merge branch 'devel' of github.com:nim-lang/Nim into devel
-rw-r--r--changelog.md6
-rw-r--r--doc/manual/procs.txt1
-rw-r--r--lib/wrappers/openssl.nim50
3 files changed, 34 insertions, 23 deletions
diff --git a/changelog.md b/changelog.md
index 3e6597ae9..bce2bcca3 100644
--- a/changelog.md
+++ b/changelog.md
@@ -212,9 +212,11 @@ for i in 1..15:
   styledEcho bgColor, bg, fgColor, fg, Nim, resetStyle
   int -= 0.01
   fg = intensity(fg, int)
-  
+
 setForegroundColor colRed
 setBackgroundColor colGreen
 styledEcho "Red on Green.", resetStyle
 ```
-
+- If you use ``--dynlibOverride:ssl`` with OpenSSL 1.0.x, you now have to
+  define ``openssl10`` symbol (``-d:openssl10``). By default OpenSSL 1.1.x is
+  assumed.
diff --git a/doc/manual/procs.txt b/doc/manual/procs.txt
index 44aeb089a..10dd39a52 100644
--- a/doc/manual/procs.txt
+++ b/doc/manual/procs.txt
@@ -571,6 +571,7 @@ Closure iterators have other restrictions than inline iterators:
 3. ``return`` is allowed in a closure iterator (but rarely useful) and ends
    iteration.
 4. Neither inline nor closure iterators can be recursive.
+5. Closure iterators are not supported by the js backend.
 
 Iterators that are neither marked ``{.closure.}`` nor ``{.inline.}`` explicitly
 default to being inline, but this may change in future versions of the
diff --git a/lib/wrappers/openssl.nim b/lib/wrappers/openssl.nim
index 1d0dc5897..a83e0c938 100644
--- a/lib/wrappers/openssl.nim
+++ b/lib/wrappers/openssl.nim
@@ -12,7 +12,9 @@
 ## When OpenSSL is dynamically linked, the wrapper provides partial forward and backward
 ## compatibility for OpenSSL versions above and below 1.1.0
 ##
-## OpenSSL can be also statically linked using dynlibOverride:ssl for OpenSSL >= 1.1.0
+## OpenSSL can also be statically linked using ``--dynlibOverride:ssl`` for OpenSSL >= 1.1.0.
+## If you want to statically link against OpenSSL 1.0.x, you now have to
+## define the ``openssl10`` symbol via ``-d:openssl10``.
 ##
 ## Build and test examples:
 ##
@@ -209,32 +211,38 @@ proc TLSv1_method*(): PSSL_METHOD{.cdecl, dynlib: DLLSSLName, importc.}
 
 when compileOption("dynlibOverride", "ssl"):
   # Static linking
-  proc OPENSSL_init_ssl*(opts: uint64, settings: uint8): cint {.cdecl, dynlib: DLLSSLName, importc, discardable.}
-  proc SSL_library_init*(): cint {.discardable.} =
-    ## Initialize SSL using OPENSSL_init_ssl for OpenSSL >= 1.1.0
-    return OPENSSL_init_ssl(0.uint64, 0.uint8)
 
-  proc TLS_method*(): PSSL_METHOD {.cdecl, dynlib: DLLSSLName, importc.}
-  proc SSLv23_method*(): PSSL_METHOD =
-    TLS_method()
+  when defined(openssl10):
+    proc SSL_library_init*(): cint {.cdecl, dynlib: DLLSSLName, importc, discardable.}
+    proc SSL_load_error_strings*() {.cdecl, dynlib: DLLSSLName, importc.}
+    proc SSLv23_method*(): PSSL_METHOD {.cdecl, dynlib: DLLSSLName, importc.}
+  else:
+    proc OPENSSL_init_ssl*(opts: uint64, settings: uint8): cint {.cdecl, dynlib: DLLSSLName, importc, discardable.}
+    proc SSL_library_init*(): cint {.discardable.} =
+      ## Initialize SSL using OPENSSL_init_ssl for OpenSSL >= 1.1.0
+      return OPENSSL_init_ssl(0.uint64, 0.uint8)
 
-  proc SSLv23_client_method*(): PSSL_METHOD {.cdecl, dynlib: DLLSSLName, importc.}
-  proc SSLv2_method*(): PSSL_METHOD {.cdecl, dynlib: DLLSSLName, importc.}
-  proc SSLv3_method*(): PSSL_METHOD {.cdecl, dynlib: DLLSSLName, importc.}
+    proc TLS_method*(): PSSL_METHOD {.cdecl, dynlib: DLLSSLName, importc.}
+    proc SSLv23_method*(): PSSL_METHOD =
+      TLS_method()
 
-  template OpenSSL_add_all_algorithms*() = discard
+    proc OpenSSL_version_num(): culong {.cdecl, dynlib: DLLSSLName, importc.}
 
-  proc OpenSSL_version_num(): culong {.cdecl, dynlib: DLLSSLName, importc.}
+    proc getOpenSSLVersion*(): culong =
+      ## Return OpenSSL version as unsigned long
+      OpenSSL_version_num()
 
-  proc getOpenSSLVersion*(): culong =
-    ## Return OpenSSL version as unsigned long
-    OpenSSL_version_num()
+    proc SSL_load_error_strings*() =
+      ## Removed from OpenSSL 1.1.0
+      # This proc prevents breaking existing code calling SslLoadErrorStrings
+      # Static linking against OpenSSL < 1.1.0 is not supported
+      discard
 
-  proc SSL_load_error_strings*() =
-    ## Removed from OpenSSL 1.1.0
-    # This proc prevents breaking existing code calling SslLoadErrorStrings
-    # Static linking against OpenSSL < 1.1.0 is not supported
-    discard
+  template OpenSSL_add_all_algorithms*() = discard
+
+  proc SSLv23_client_method*(): PSSL_METHOD {.cdecl, dynlib: DLLSSLName, importc.}
+  proc SSLv2_method*(): PSSL_METHOD {.cdecl, dynlib: DLLSSLName, importc.}
+  proc SSLv3_method*(): PSSL_METHOD {.cdecl, dynlib: DLLSSLName, importc.}
 
 else:
   # Here we're trying to stay compatible with openssl 1.0.* and 1.1.*. Some