diff options
author | Sergey Elin <[email protected]> | 2017-09-28 12:13:20 +0300 |
---|---|---|
committer | Sergey Elin <[email protected]> | 2017-09-28 22:11:57 +0300 |
commit | 4e4b2cbb3cfecf2faeb82442655b44bf306d1cce (patch) | |
tree | c35d693eb3bd7939ae7d316f25f8fb001f577b7c /kerl | |
parent | d8895d41c58ee8a89b1b6a6505f596f73e846b26 (diff) | |
download | kerl-4e4b2cbb3cfecf2faeb82442655b44bf306d1cce.tar.gz kerl-4e4b2cbb3cfecf2faeb82442655b44bf306d1cce.tar.bz2 kerl-4e4b2cbb3cfecf2faeb82442655b44bf306d1cce.zip |
Fix point arithmetic in wx_impl.cpp for Erlang < 20.0
Diffstat (limited to 'kerl')
-rwxr-xr-x | kerl | 63 |
1 files changed, 63 insertions, 0 deletions
@@ -482,6 +482,12 @@ maybe_patch_all() 15) apply_r15_beam_makeops_patch >> "$LOGFILE" ;; + 16) + apply_r16_wx_ptr_patch >> "$LOGFILE" + ;; + 17|18|19) + apply_wx_ptr_patch >> "$LOGFILE" + ;; *) ;; esac @@ -1478,6 +1484,63 @@ apply_r15_beam_makeops_patch() _END_PATCH } +#https://github.com/erlang/otp/commit/a64c4d806fa54848c35632114585ad82b98712e8.diff +apply_wx_ptr_patch() +{ + patch -p1 <<'_END_PATCH' +diff --git a/lib/wx/c_src/wxe_impl.cpp b/lib/wx/c_src/wxe_impl.cpp +index 0d2da5d4a79..8118136d30e 100644 +--- a/lib/wx/c_src/wxe_impl.cpp ++++ b/lib/wx/c_src/wxe_impl.cpp +@@ -666,7 +666,7 @@ void * WxeApp::getPtr(char * bp, wxeMemEnv *memenv) { + throw wxe_badarg(index); + } + void * temp = memenv->ref2ptr[index]; +- if((index < memenv->next) && ((index == 0) || (temp > NULL))) ++ if((index < memenv->next) && ((index == 0) || (temp != (void *)NULL))) + return temp; + else { + throw wxe_badarg(index); +@@ -678,7 +678,7 @@ void WxeApp::registerPid(char * bp, ErlDrvTermData pid, wxeMemEnv * memenv) { + if(!memenv) + throw wxe_badarg(index); + void * temp = memenv->ref2ptr[index]; +- if((index < memenv->next) && ((index == 0) || (temp > NULL))) { ++ if((index < memenv->next) && ((index == 0) || (temp != (void *) NULL))) { + ptrMap::iterator it; + it = ptr2ref.find(temp); + if(it != ptr2ref.end()) { +_END_PATCH +} + +apply_r16_wx_ptr_patch() +{ + patch -p1 <<'_END_PATCH' +diff --git a/lib/wx/c_src/wxe_impl.cpp b/lib/wx/c_src/wxe_impl.cpp +index cc9bcc995..1b1912630 100644 +--- a/lib/wx/c_src/wxe_impl.cpp ++++ b/lib/wx/c_src/wxe_impl.cpp +@@ -757,7 +757,7 @@ void * WxeApp::getPtr(char * bp, wxeMemEnv *memenv) { + throw wxe_badarg(index); + } + void * temp = memenv->ref2ptr[index]; +- if((index < memenv->next) && ((index == 0) || (temp > NULL))) ++ if((index < memenv->next) && ((index == 0) || (temp != (void *)NULL))) + return temp; + else { + throw wxe_badarg(index); +@@ -769,7 +769,7 @@ void WxeApp::registerPid(char * bp, ErlDrvTermData pid, wxeMemEnv * memenv) { + if(!memenv) + throw wxe_badarg(index); + void * temp = memenv->ref2ptr[index]; +- if((index < memenv->next) && ((index == 0) || (temp > NULL))) { ++ if((index < memenv->next) && ((index == 0) || (temp != (void *)NULL))) { + ptrMap::iterator it; + it = ptr2ref.find(temp); + if(it != ptr2ref.end()) { +_END_PATCH +} + case "$1" in version) echo "$KERL_VERSION" |