Skip to content

Commit a40ee1f

Browse files
author
Sascha Schumann
committed
Actually compile on systems without syslog.
PR: #9412
1 parent adb3e39 commit a40ee1f

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

ext/standard/basic_functions.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,10 +507,12 @@ function_entry basic_functions[] = {
507507
PHP_FE(ezmlm_hash, NULL)
508508

509509
/* functions from syslog.c */
510+
#ifdef HAVE_SYSLOG_H
510511
PHP_FE(openlog, NULL)
511512
PHP_FE(syslog, NULL)
512513
PHP_FE(closelog, NULL)
513514
PHP_FE(define_syslog_variables, NULL)
515+
#endif
514516

515517
/* functions from lcg.c */
516518
PHP_FE(lcg_value, NULL)

ext/standard/php_ext_syslog.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525

2626
#include "php_syslog.h"
2727

28-
extern PHP_MINIT_FUNCTION(syslog);
29-
extern PHP_RINIT_FUNCTION(syslog);
30-
extern PHP_RSHUTDOWN_FUNCTION(syslog);
28+
PHP_MINIT_FUNCTION(syslog);
29+
PHP_RINIT_FUNCTION(syslog);
30+
PHP_RSHUTDOWN_FUNCTION(syslog);
3131

3232
PHP_FUNCTION(openlog);
3333
PHP_FUNCTION(syslog);

ext/standard/syslog.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
/* $Id$ */
2020

2121
#include "php.h"
22+
23+
#ifdef HAVE_SYSLOG_H
2224
#include "php_ini.h"
2325
#include "zend_globals.h"
2426

@@ -262,6 +264,8 @@ PHP_FUNCTION(syslog)
262264
}
263265
/* }}} */
264266

267+
#endif
268+
265269
/*
266270
* Local variables:
267271
* tab-width: 4

main/php_syslog.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
#ifdef PHP_WIN32
55
#include "win32/syslog.h"
66
#else
7+
#include "php_config.h"
8+
#ifdef HAVE_SYSLOG_H
79
#include <syslog.h>
810
#endif
11+
#endif
912

1013
/*
1114
* The SCO OpenServer 5 Development System (not the UDK)

0 commit comments

Comments
 (0)