Skip to content

Commit 00c4f49

Browse files
committed
Fix [-Wundef] warning in GetText extension
1 parent 7ffc2d4 commit 00c4f49

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

ext/gettext/gettext.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include "php.h"
2222

23-
#if HAVE_LIBINTL
23+
#ifdef HAVE_LIBINTL
2424

2525
#include <stdio.h>
2626
#include "ext/standard/info.h"
@@ -197,7 +197,7 @@ PHP_FUNCTION(bindtextdomain)
197197
}
198198
/* }}} */
199199

200-
#if HAVE_NGETTEXT
200+
#ifdef HAVE_NGETTEXT
201201
/* {{{ proto string ngettext(string MSGID1, string MSGID2, int N)
202202
Plural version of gettext() */
203203
PHP_FUNCTION(ngettext)
@@ -221,7 +221,7 @@ PHP_FUNCTION(ngettext)
221221
/* }}} */
222222
#endif
223223

224-
#if HAVE_DNGETTEXT
224+
#ifdef HAVE_DNGETTEXT
225225
/* {{{ proto string dngettext(string domain, string msgid1, string msgid2, int count)
226226
Plural version of dgettext() */
227227
PHP_FUNCTION(dngettext)
@@ -247,7 +247,7 @@ PHP_FUNCTION(dngettext)
247247
/* }}} */
248248
#endif
249249

250-
#if HAVE_DCNGETTEXT
250+
#ifdef HAVE_DCNGETTEXT
251251
/* {{{ proto string dcngettext(string domain, string msgid1, string msgid2, int n, int category)
252252
Plural version of dcgettext() */
253253
PHP_FUNCTION(dcngettext)
@@ -275,7 +275,7 @@ PHP_FUNCTION(dcngettext)
275275
/* }}} */
276276
#endif
277277

278-
#if HAVE_BIND_TEXTDOMAIN_CODESET
278+
#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
279279

280280
/* {{{ proto string bind_textdomain_codeset(string domain, string codeset)
281281
Specify the character encoding in which the messages from the DOMAIN message catalog will be returned. */

ext/gettext/gettext.stub.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ function dcgettext(string $domain_name, string $msgid, int $category): string|fa
1515

1616
function bindtextdomain(string $domain_name, string $dir): string|false {}
1717

18-
#if HAVE_NGETTEXT
18+
#ifdef HAVE_NGETTEXT
1919
function ngettext(string $msgid1, string $msgid2, int $n): string|false {}
2020
#endif
2121

22-
#if HAVE_DNGETTEXT
22+
#ifdef HAVE_DNGETTEXT
2323
function dngettext(string $domain, string $msgid1, string $msgid2, int $count): string|false {}
2424
#endif
2525

26-
#if HAVE_DCNGETTEXT
26+
#ifdef HAVE_DCNGETTEXT
2727
function dcngettext(string $domain, string $msgid1, string $msgid2, int $count, int $category): string|false {}
2828
#endif
2929

30-
#if HAVE_BIND_TEXTDOMAIN_CODESET
30+
#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
3131
function bind_textdomain_codeset(string $domain, string $codeset): string|false {}
3232
#endif

ext/gettext/gettext_arginfo.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_bindtextdomain, 0, 2, MAY_BE_STR
2626
ZEND_ARG_TYPE_INFO(0, dir, IS_STRING, 0)
2727
ZEND_END_ARG_INFO()
2828

29-
#if HAVE_NGETTEXT
29+
#if defined(HAVE_NGETTEXT)
3030
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ngettext, 0, 3, MAY_BE_STRING|MAY_BE_FALSE)
3131
ZEND_ARG_TYPE_INFO(0, msgid1, IS_STRING, 0)
3232
ZEND_ARG_TYPE_INFO(0, msgid2, IS_STRING, 0)
3333
ZEND_ARG_TYPE_INFO(0, n, IS_LONG, 0)
3434
ZEND_END_ARG_INFO()
3535
#endif
3636

37-
#if HAVE_DNGETTEXT
37+
#if defined(HAVE_DNGETTEXT)
3838
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_dngettext, 0, 4, MAY_BE_STRING|MAY_BE_FALSE)
3939
ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 0)
4040
ZEND_ARG_TYPE_INFO(0, msgid1, IS_STRING, 0)
@@ -43,7 +43,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_dngettext, 0, 4, MAY_BE_STRING|M
4343
ZEND_END_ARG_INFO()
4444
#endif
4545

46-
#if HAVE_DCNGETTEXT
46+
#if defined(HAVE_DCNGETTEXT)
4747
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_dcngettext, 0, 5, MAY_BE_STRING|MAY_BE_FALSE)
4848
ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 0)
4949
ZEND_ARG_TYPE_INFO(0, msgid1, IS_STRING, 0)
@@ -53,7 +53,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_dcngettext, 0, 5, MAY_BE_STRING|
5353
ZEND_END_ARG_INFO()
5454
#endif
5555

56-
#if HAVE_BIND_TEXTDOMAIN_CODESET
56+
#if defined(HAVE_BIND_TEXTDOMAIN_CODESET)
5757
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_bind_textdomain_codeset, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
5858
ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 0)
5959
ZEND_ARG_TYPE_INFO(0, codeset, IS_STRING, 0)
@@ -66,16 +66,16 @@ ZEND_FUNCTION(gettext);
6666
ZEND_FUNCTION(dgettext);
6767
ZEND_FUNCTION(dcgettext);
6868
ZEND_FUNCTION(bindtextdomain);
69-
#if HAVE_NGETTEXT
69+
#if defined(HAVE_NGETTEXT)
7070
ZEND_FUNCTION(ngettext);
7171
#endif
72-
#if HAVE_DNGETTEXT
72+
#if defined(HAVE_DNGETTEXT)
7373
ZEND_FUNCTION(dngettext);
7474
#endif
75-
#if HAVE_DCNGETTEXT
75+
#if defined(HAVE_DCNGETTEXT)
7676
ZEND_FUNCTION(dcngettext);
7777
#endif
78-
#if HAVE_BIND_TEXTDOMAIN_CODESET
78+
#if defined(HAVE_BIND_TEXTDOMAIN_CODESET)
7979
ZEND_FUNCTION(bind_textdomain_codeset);
8080
#endif
8181

@@ -87,16 +87,16 @@ static const zend_function_entry ext_functions[] = {
8787
ZEND_FE(dgettext, arginfo_dgettext)
8888
ZEND_FE(dcgettext, arginfo_dcgettext)
8989
ZEND_FE(bindtextdomain, arginfo_bindtextdomain)
90-
#if HAVE_NGETTEXT
90+
#if defined(HAVE_NGETTEXT)
9191
ZEND_FE(ngettext, arginfo_ngettext)
9292
#endif
93-
#if HAVE_DNGETTEXT
93+
#if defined(HAVE_DNGETTEXT)
9494
ZEND_FE(dngettext, arginfo_dngettext)
9595
#endif
96-
#if HAVE_DCNGETTEXT
96+
#if defined(HAVE_DCNGETTEXT)
9797
ZEND_FE(dcngettext, arginfo_dcngettext)
9898
#endif
99-
#if HAVE_BIND_TEXTDOMAIN_CODESET
99+
#if defined(HAVE_BIND_TEXTDOMAIN_CODESET)
100100
ZEND_FE(bind_textdomain_codeset, arginfo_bind_textdomain_codeset)
101101
#endif
102102
ZEND_FE_END

ext/gettext/php_gettext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#ifndef PHP_GETTEXT_H
1818
#define PHP_GETTEXT_H
1919

20-
#if HAVE_LIBINTL
20+
#ifdef HAVE_LIBINTL
2121

2222
extern zend_module_entry php_gettext_module_entry;
2323
#define gettext_module_ptr &php_gettext_module_entry

0 commit comments

Comments
 (0)