Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichael-grunder <michael.grunder@gmail.com>2019-02-09 08:31:47 +0300
committermichael-grunder <michael.grunder@gmail.com>2019-02-09 08:31:47 +0300
commitfa130a4bd46200d799f0659b709c8062c87f692b (patch)
treefdeb696c1e1ec9db02b765deefc38eaedd4188c9 /library.h
parentf9928642b5e539bbdca43ec51ed9c9642cb42ded (diff)
PHP 7 exception and compiler warning fixes
PHP 7 removed TSRMLS_CC from zend_throw_exception* routines. Additionally this commit creates two simple wrapper macros for throwing Redis or RedisCluster exceptions so we don't duplicate as much code. Additionally there were a couple of minor compiler warnings printf type correctness fixed in this commit.
Diffstat (limited to 'library.h')
-rw-r--r--library.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/library.h b/library.h
index a7a2f060..3028711c 100644
--- a/library.h
+++ b/library.h
@@ -14,6 +14,12 @@
#define REDIS_CMD_INIT_SSTR_STATIC(sstr, argc, keyword) \
redis_cmd_init_sstr(sstr, argc, keyword, sizeof(keyword)-1);
+#define REDIS_THROW_EXCEPTION(msg, code) \
+ zend_throw_exception(redis_exception_ce, (msg), code)
+
+#define CLUSTER_THROW_EXCEPTION(msg, code) \
+ zend_throw_exception(redis_cluster_exception_ce, (msg), code)
+
int redis_cmd_init_sstr(smart_string *str, int num_args, char *keyword, int keyword_len);
int redis_cmd_append_sstr(smart_string *str, char *append, int append_len);
int redis_cmd_append_sstr_int(smart_string *str, int append);