Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6ebb36c

Browse files
Get rid of ifdefs
1 parent a013d24 commit 6ebb36c

2 files changed

Lines changed: 0 additions & 42 deletions

File tree

common.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -275,17 +275,10 @@ typedef struct {
275275
int nb_active;
276276
} ConnectionPool;
277277

278-
#if (PHP_MAJOR_VERSION < 7)
279-
typedef struct {
280-
zend_object std;
281-
RedisSock *sock;
282-
} redis_object;
283-
#else
284278
typedef struct {
285279
RedisSock *sock;
286280
zend_object std;
287281
} redis_object;
288-
#endif
289282

290283
/** Argument info for any function expecting 0 args */
291284
ZEND_BEGIN_ARG_INFO_EX(arginfo_void, 0, 0, 0)

library.c

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -38,41 +38,6 @@
3838
#include <sys/socket.h> /* SO_KEEPALIVE */
3939
#else
4040
#include <winsock.h>
41-
42-
# if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION <= 4
43-
/* This proto is available from 5.5 on only */
44-
PHP_REDIS_API int usleep(unsigned int useconds);
45-
# endif
46-
#endif
47-
48-
#if (PHP_MAJOR_VERSION < 7)
49-
int (*_add_next_index_string)(zval *, const char *, int) = &add_next_index_string;
50-
int (*_add_next_index_stringl)(zval *, const char *, uint, int) = &add_next_index_stringl;
51-
int (*_add_assoc_bool_ex)(zval *, const char *, uint, int) = &add_assoc_bool_ex;
52-
int (*_add_assoc_long_ex)(zval *, const char *, uint, long) = &add_assoc_long_ex;
53-
int (*_add_assoc_double_ex)(zval *, const char *, uint, double) = &add_assoc_double_ex;
54-
int (*_add_assoc_string_ex)(zval *, const char *, uint, char *, int) = &add_assoc_string_ex;
55-
int (*_add_assoc_stringl_ex)(zval *, const char *, uint, char *, uint, int) = &add_assoc_stringl_ex;
56-
int (*_add_assoc_zval_ex)(zval *, const char *, uint, zval *) = &add_assoc_zval_ex;
57-
void (*_php_var_serialize)(smart_str *, zval **, php_serialize_data_t * TSRMLS_DC) = &php_var_serialize;
58-
int (*_php_var_unserialize)(zval **, const unsigned char **, const unsigned char *, php_unserialize_data_t * TSRMLS_DC) = &php_var_unserialize;
59-
60-
#define strpprintf zend_strpprintf
61-
62-
static zend_string *
63-
zend_strpprintf(size_t max_len, const char *format, ...)
64-
{
65-
va_list ap;
66-
zend_string *zstr;
67-
68-
va_start(ap, format);
69-
zstr = ecalloc(1, sizeof(*zstr));
70-
ZSTR_LEN(zstr) = vspprintf(&ZSTR_VAL(zstr), max_len, format, ap);
71-
zstr->gc = 0x11;
72-
va_end(ap);
73-
return zstr;
74-
}
75-
7641
#endif
7742

7843
extern zend_class_entry *redis_ce;

0 commit comments

Comments
 (0)