From 795acc13c81b0176a6a908fe4adf376969d3e538 Mon Sep 17 00:00:00 2001 From: Ding Li Date: Mon, 23 Oct 2017 22:13:23 +0800 Subject: [PATCH] Fix #12 (#1, #4, #9): SocketOptions curve key argument causes compile error --- Include/Zmq/SocketOptions.mqh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Include/Zmq/SocketOptions.mqh b/Include/Zmq/SocketOptions.mqh index 384ae23..72045ba 100644 --- a/Include/Zmq/SocketOptions.mqh +++ b/Include/Zmq/SocketOptions.mqh @@ -184,10 +184,13 @@ public: SOCKOPT_GET_BYTES(OptionName,Macro,InitSize) //--- for curve key + //--- NOTE that the length of the key array must be 32. + //--- since some versions of mt4 and newer versions of mt5 will report error + //--- when the length of the array is specified, so the length specification is removed #define SOCKOPT_CURVE_KEY(KeyType,Macro) \ - bool getCurve##KeyType##Key(uchar &key[32]) {size_t len=32; return getOption(Macro,key,len);} \ + bool getCurve##KeyType##Key(uchar &key[]) {size_t len=32; return getOption(Macro,key,len);} \ bool getCurve##KeyType##Key(string &key) {return getStringOption(Macro,key,41);} \ - bool setCurve##KeyType##Key(const uchar &key[32]) {return setOption(Macro,key,32);} \ + bool setCurve##KeyType##Key(const uchar &key[]) {return setOption(Macro,key,32);} \ bool setCurve##KeyType##Key(string key) {return setStringOption(Macro,key);} SOCKOPT_GET(int,Type,ZMQ_TYPE)