Skip to content

Commit feeddc5

Browse files
committed
- apc support and fix DLL export
1 parent a0e7683 commit feeddc5

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

config.w32

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
ARG_ENABLE("fastlz", "whether to enable fastlz support", "no");
55

66
if (PHP_FASTLZ == "yes") {
7+
res = CHECK_HEADER_ADD_INCLUDE("apc_serializer.h", "CFLAGS_FASTLZ", "..\\pecl\\apc;ext\\apc");
8+
if (res) {
9+
AC_DEFINE('HAVE_APC_SUPPORT', 1, 'Whether to enable apc support')
10+
}
711
EXTENSION("fastlz", "php_fastlz.c", true)
812
ADD_SOURCES(configure_module_dirname + "/libfastlz", "fastlz.c ", "fastlz");
913
}

php_fastlz.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@
2929
#include "SAPI.h"
3030
#ifdef PHP_WIN32
3131
# include "win32/php_stdint.h"
32+
# include <Winsock2.h>
3233
#else
3334
# include "stdint.h"
35+
# include "arpa/inet.h"
3436
#endif
3537

36-
#include "arpa/inet.h"
3738

3839
#ifdef HAVE_APC_SUPPORT
3940
# include "ext/standard/php_var.h"
@@ -121,7 +122,7 @@ ZEND_GET_MODULE(fastlz)
121122
#endif
122123

123124
/* {{{ fastlz helper functions */
124-
PHPAPI int fastlz_xcompress(char *value, int value_len, char** cvalue TSRMLS_DC)
125+
PHP_FASTLZ_API int fastlz_xcompress(char *value, int value_len, char** cvalue TSRMLS_DC)
125126
{
126127
uint32_t compressed_len;
127128
char *compressed;
@@ -147,7 +148,7 @@ PHPAPI int fastlz_xcompress(char *value, int value_len, char** cvalue TSRMLS_DC)
147148
return 0;
148149
}
149150

150-
PHPAPI int fastlz_xdecompress(char *compressed, int compressed_len, char** uvalue TSRMLS_DC)
151+
PHP_FASTLZ_API int fastlz_xdecompress(char *compressed, int compressed_len, char** uvalue TSRMLS_DC)
151152
{
152153
uint32_t value_len;
153154

php_fastlz.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ ZEND_EXTERN_MODULE_GLOBALS(fastlz)
5757
#define FASTLZ_G(v) (fastlz_globals.v)
5858
#endif
5959

60-
PHPAPI int fastlz_xdecompress(char *compressed, int compressed_len, char** uvalue TSRMLS_DC);
61-
PHPAPI int fastlz_xcompress(char *value, int value_len, char** cvalue TSRMLS_DC);
60+
PHP_FASTLZ_API int fastlz_xdecompress(char *compressed, int compressed_len, char** uvalue TSRMLS_DC);
61+
PHP_FASTLZ_API int fastlz_xcompress(char *value, int value_len, char** cvalue TSRMLS_DC);
6262

6363
#endif /* PHP_FASTLZ_H */
6464

0 commit comments

Comments
 (0)