Skip to content

Declare ext/sysvmsg constants in stubs #9125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ext/sysvmsg/php_sysvmsg.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,11 @@ extern zend_module_entry sysvmsg_module_entry;

#endif /* HAVE_SYSVMSG */

/* In order to detect MSG_EXCEPT use at run time; we have no way
* of knowing what the bit definitions are, so we can't just define
* our own MSG_EXCEPT value. */
#define PHP_MSG_IPC_NOWAIT 1
#define PHP_MSG_NOERROR 2
#define PHP_MSG_EXCEPT 4

#endif /* PHP_SYSVMSG_H */
14 changes: 2 additions & 12 deletions ext/sysvmsg/sysvmsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@ struct php_msgbuf {
char mtext[1];
};

/* In order to detect MSG_EXCEPT use at run time; we have no way
* of knowing what the bit definitions are, so we can't just define
* out own MSG_EXCEPT value. */
#define PHP_MSG_IPC_NOWAIT 1
#define PHP_MSG_NOERROR 2
#define PHP_MSG_EXCEPT 4

/* {{{ sysvmsg_module_entry */
zend_module_entry sysvmsg_module_entry = {
STANDARD_MODULE_HEADER,
Expand Down Expand Up @@ -117,11 +110,8 @@ PHP_MINIT_FUNCTION(sysvmsg)
sysvmsg_queue_object_handlers.clone_obj = NULL;
sysvmsg_queue_object_handlers.compare = zend_objects_not_comparable;

REGISTER_LONG_CONSTANT("MSG_IPC_NOWAIT", PHP_MSG_IPC_NOWAIT, CONST_PERSISTENT|CONST_CS);
REGISTER_LONG_CONSTANT("MSG_EAGAIN", EAGAIN, CONST_PERSISTENT|CONST_CS);
REGISTER_LONG_CONSTANT("MSG_ENOMSG", ENOMSG, CONST_PERSISTENT|CONST_CS);
REGISTER_LONG_CONSTANT("MSG_NOERROR", PHP_MSG_NOERROR, CONST_PERSISTENT|CONST_CS);
REGISTER_LONG_CONSTANT("MSG_EXCEPT", PHP_MSG_EXCEPT, CONST_PERSISTENT|CONST_CS);
register_sysvmsg_symbols(module_number);

return SUCCESS;
}
/* }}} */
Expand Down
26 changes: 26 additions & 0 deletions ext/sysvmsg/sysvmsg.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@

/** @generate-class-entries */

/**
* @var int
* @cvalue PHP_MSG_IPC_NOWAIT
*/
const MSG_IPC_NOWAIT = UNKNOWN;
/**
* @var int
* @cvalue EAGAIN
*/
const MSG_EAGAIN = UNKNOWN;
/**
* @var int
* @cvalue ENOMSG
*/
const MSG_ENOMSG = UNKNOWN;
/**
* @var int
* @cvalue PHP_MSG_NOERROR
*/
const MSG_NOERROR = UNKNOWN;
/**
* @var int
* @cvalue PHP_MSG_EXCEPT
*/
const MSG_EXCEPT = UNKNOWN;

/**
* @strict-properties
* @not-serializable
Expand Down
11 changes: 10 additions & 1 deletion ext/sysvmsg/sysvmsg_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.