Skip to content

Commit 93a5365

Browse files
author
Holger Zimmermann
committed
Added PHP4PI3WEB_EXPORTS in order to control exports/imports on Win32
1 parent de76ceb commit 93a5365

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

sapi/pi3web/php4pi3web.dsp

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sapi/pi3web/pi3web_sapi.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@
4040
#include "PiAPI.h"
4141
#include "Pi3API.h"
4242

43-
#define MAX_STATUS_LENGTH sizeof("xxxx LONGEST STATUS DESCRIPTION")
4443
#define PI3WEB_SERVER_VAR_BUF_SIZE 1024
45-
#define PI3WEB_POST_DATA_BUF 1024
4644

4745
int IWasLoaded=0;
4846

@@ -233,7 +231,7 @@ static int sapi_pi3web_read_post(char *buffer, uint count_bytes TSRMLS_DC)
233231
DWORD read_from_input=0;
234232
DWORD total_read=0;
235233

236-
if (SG(read_post_bytes) < lpCB->cbAvailable) {
234+
if ((DWORD)SG(read_post_bytes) < lpCB->cbAvailable) {
237235
read_from_buf = MIN(lpCB->cbAvailable-SG(read_post_bytes), count_bytes);
238236
memcpy(buffer, lpCB->lpbData+SG(read_post_bytes), read_from_buf);
239237
total_read += read_from_buf;
@@ -385,7 +383,7 @@ static sapi_module_struct pi3web_sapi_module = {
385383
STANDARD_SAPI_MODULE_PROPERTIES
386384
};
387385

388-
DWORD PHP4_wrapper(LPCONTROL_BLOCK lpCB)
386+
MODULE_API DWORD PHP4_wrapper(LPCONTROL_BLOCK lpCB)
389387
{
390388
zend_file_handle file_handle;
391389
int iRet = PIAPI_COMPLETED;
@@ -454,7 +452,7 @@ DWORD PHP4_wrapper(LPCONTROL_BLOCK lpCB)
454452
return iRet;
455453
}
456454

457-
BOOL PHP4_startup() {
455+
MODULE_API BOOL PHP4_startup() {
458456
tsrm_startup(1, 1, 0, NULL);
459457
sapi_startup(&pi3web_sapi_module);
460458
if (pi3web_sapi_module.startup) {
@@ -464,7 +462,7 @@ BOOL PHP4_startup() {
464462
return IWasLoaded;
465463
};
466464

467-
BOOL PHP4_shutdown() {
465+
MODULE_API BOOL PHP4_shutdown() {
468466
if (pi3web_sapi_module.shutdown) {
469467
pi3web_sapi_module.shutdown(&pi3web_sapi_module);
470468
};

sapi/pi3web/pi3web_sapi.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#ifdef PHP_WIN32
55
# include <windows.h>
66
# include <httpext.h>
7-
# ifdef SAPI_EXPORTS
7+
# ifdef PHP4PI3WEB_EXPORTS
88
# define MODULE_API __declspec(dllexport)
99
# else
1010
# define MODULE_API __declspec(dllimport)
@@ -79,9 +79,9 @@ typedef struct _CONTROL_BLOCK {
7979

8080
} CONTROL_BLOCK, *LPCONTROL_BLOCK;
8181

82-
DWORD PHP4_wrapper(LPCONTROL_BLOCK lpCB);
83-
BOOL PHP4_startup();
84-
BOOL PHP4_shutdown();
82+
MODULE_API DWORD PHP4_wrapper(LPCONTROL_BLOCK lpCB);
83+
MODULE_API BOOL PHP4_startup();
84+
MODULE_API BOOL PHP4_shutdown();
8585

8686
// the following type declaration is for the server side
8787
typedef DWORD ( * PFN_WRAPPERFUNC )( CONTROL_BLOCK *pCB );

0 commit comments

Comments
 (0)