mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-22 18:17:09 +00:00
libapparmor: swig: specify message for static_assert usages
The message being optional is apparently a C23 thing that was available as an extension on the systems I tested on previously Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
This commit is contained in:
parent
c5016e1227
commit
87b60e4e94
@ -258,7 +258,7 @@ extern int aa_is_enabled(void);
|
|||||||
* allocation uninitialized (0) != SWIG_NEWOBJ
|
* allocation uninitialized (0) != SWIG_NEWOBJ
|
||||||
*/
|
*/
|
||||||
%#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
%#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
||||||
static_assert(SWIG_NEWOBJ != 0);
|
static_assert(SWIG_NEWOBJ != 0, "SWIG_NEWOBJ is 0");
|
||||||
%#endif
|
%#endif
|
||||||
if ($1 != NULL && alloc_tracking$argnum != NULL) {
|
if ($1 != NULL && alloc_tracking$argnum != NULL) {
|
||||||
for (Py_ssize_t i=0; i<seq_len$argnum; i++) {
|
for (Py_ssize_t i=0; i<seq_len$argnum; i++) {
|
||||||
@ -323,7 +323,8 @@ extern int aa_stack_onexec(const char *profile);
|
|||||||
*/
|
*/
|
||||||
%typemap(in,noblock=1,fragment="SWIG_AsVal_long") pid_t (int conv_pid, long pid_large) {
|
%typemap(in,noblock=1,fragment="SWIG_AsVal_long") pid_t (int conv_pid, long pid_large) {
|
||||||
%#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
%#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
||||||
static_assert(sizeof(pid_t) <= sizeof(long));
|
static_assert(sizeof(pid_t) <= sizeof(long),
|
||||||
|
"pid_t type is too large to be stored in a long");
|
||||||
%#endif
|
%#endif
|
||||||
conv_pid = SWIG_AsVal_long($input, &pid_large);
|
conv_pid = SWIG_AsVal_long($input, &pid_large);
|
||||||
if (!SWIG_IsOK(conv_pid)) {
|
if (!SWIG_IsOK(conv_pid)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user