Skip to content

Commit 4ad7e72

Browse files
kocsismatecmb69
andauthored
Declare ext/sysvmsg constants in stubs (#9125)
Co-authored-by: Christoph M. Becker <[email protected]>
1 parent 87cf05e commit 4ad7e72

File tree

4 files changed

+45
-13
lines changed

4 files changed

+45
-13
lines changed

ext/sysvmsg/php_sysvmsg.h

+7
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,11 @@ extern zend_module_entry sysvmsg_module_entry;
2727

2828
#endif /* HAVE_SYSVMSG */
2929

30+
/* In order to detect MSG_EXCEPT use at run time; we have no way
31+
* of knowing what the bit definitions are, so we can't just define
32+
* our own MSG_EXCEPT value. */
33+
#define PHP_MSG_IPC_NOWAIT 1
34+
#define PHP_MSG_NOERROR 2
35+
#define PHP_MSG_EXCEPT 4
36+
3037
#endif /* PHP_SYSVMSG_H */

ext/sysvmsg/sysvmsg.c

+2-12
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@ struct php_msgbuf {
4444
char mtext[1];
4545
};
4646

47-
/* In order to detect MSG_EXCEPT use at run time; we have no way
48-
* of knowing what the bit definitions are, so we can't just define
49-
* out own MSG_EXCEPT value. */
50-
#define PHP_MSG_IPC_NOWAIT 1
51-
#define PHP_MSG_NOERROR 2
52-
#define PHP_MSG_EXCEPT 4
53-
5447
/* {{{ sysvmsg_module_entry */
5548
zend_module_entry sysvmsg_module_entry = {
5649
STANDARD_MODULE_HEADER,
@@ -117,11 +110,8 @@ PHP_MINIT_FUNCTION(sysvmsg)
117110
sysvmsg_queue_object_handlers.clone_obj = NULL;
118111
sysvmsg_queue_object_handlers.compare = zend_objects_not_comparable;
119112

120-
REGISTER_LONG_CONSTANT("MSG_IPC_NOWAIT", PHP_MSG_IPC_NOWAIT, CONST_PERSISTENT|CONST_CS);
121-
REGISTER_LONG_CONSTANT("MSG_EAGAIN", EAGAIN, CONST_PERSISTENT|CONST_CS);
122-
REGISTER_LONG_CONSTANT("MSG_ENOMSG", ENOMSG, CONST_PERSISTENT|CONST_CS);
123-
REGISTER_LONG_CONSTANT("MSG_NOERROR", PHP_MSG_NOERROR, CONST_PERSISTENT|CONST_CS);
124-
REGISTER_LONG_CONSTANT("MSG_EXCEPT", PHP_MSG_EXCEPT, CONST_PERSISTENT|CONST_CS);
113+
register_sysvmsg_symbols(module_number);
114+
125115
return SUCCESS;
126116
}
127117
/* }}} */

ext/sysvmsg/sysvmsg.stub.php

+26
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,32 @@
22

33
/** @generate-class-entries */
44

5+
/**
6+
* @var int
7+
* @cvalue PHP_MSG_IPC_NOWAIT
8+
*/
9+
const MSG_IPC_NOWAIT = UNKNOWN;
10+
/**
11+
* @var int
12+
* @cvalue EAGAIN
13+
*/
14+
const MSG_EAGAIN = UNKNOWN;
15+
/**
16+
* @var int
17+
* @cvalue ENOMSG
18+
*/
19+
const MSG_ENOMSG = UNKNOWN;
20+
/**
21+
* @var int
22+
* @cvalue PHP_MSG_NOERROR
23+
*/
24+
const MSG_NOERROR = UNKNOWN;
25+
/**
26+
* @var int
27+
* @cvalue PHP_MSG_EXCEPT
28+
*/
29+
const MSG_EXCEPT = UNKNOWN;
30+
531
/**
632
* @strict-properties
733
* @not-serializable

ext/sysvmsg/sysvmsg_arginfo.h

+10-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)