[OpenSmalltalk/opensmalltalk-vm] 2783b4: [SqueakSSL][overlay] fix "null function"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[OpenSmalltalk/opensmalltalk-vm] 2783b4: [SqueakSSL][overlay] fix "null function"

GitHub
 
  Branch: refs/heads/Cog
  Home:   https://github.com/OpenSmalltalk/opensmalltalk-vm
  Commit: 2783b44298b63027f43bf70646b776e1e4a0384d
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/2783b44298b63027f43bf70646b776e1e4a0384d
  Author: Tobias Pape <[hidden email]>
  Date:   2018-03-12 (Mon, 12 Mar 2018)

  Changed paths:
    M platforms/unix/plugins/SqueakSSL/openssl_overlay.h

  Log Message:
  -----------
  [SqueakSSL][overlay] fix "null function"

we define all functions not availiable at link time (because we know
what is available in which openssl release) as "null function", i.e., a
function pointer that will pass as "false" in an `if (func) { ... }`
construct.

Deconstruction:
```C
((void*(*)())NULL)
```

 - `NULL` is the part that evaluates to "not true" in the expression to
    the if
 - `(*)` makes it a function pointer
 - `void*` returning anything (most importantly, something assignable to
    anything)
 -  `()` not specifiying what kind of arguments will come in.

All this should be standard-compliant