From: Matthew Heon <[email protected]> It appears the CGo did not like the use of preprocessor constants in return. Assign them to variables before using them to fix this.
Also fixes tab size in some CGo code Signed-off-by: Matthew Heon <[email protected]> --- seccomp_internal.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/seccomp_internal.go b/seccomp_internal.go index 369f194..5b6a79a 100644 --- a/seccomp_internal.go +++ b/seccomp_internal.go @@ -86,35 +86,39 @@ const int C_CMP_GE = (int)SCMP_CMP_GE; const int C_CMP_GT = (int)SCMP_CMP_GT; const int C_CMP_MASKED_EQ = (int)SCMP_CMP_MASKED_EQ; +const int C_VERSION_MAJOR = SCMP_VER_MAJOR; +const int C_VERSION_MINOR = SCMP_VER_MINOR; +const int C_VERSION_MICRO = SCMP_VER_MICRO; + #if SCMP_VER_MAJOR == 2 && SCMP_VER_MINOR >= 3 unsigned int get_major_version() { - return seccomp_version()->major; + return seccomp_version()->major; } unsigned int get_minor_version() { - return seccomp_version()->minor; + return seccomp_version()->minor; } unsigned int get_micro_version() { - return seccomp_version()->micro; + return seccomp_version()->micro; } #else unsigned int get_major_version() { - return (unsigned int)SCMP_MAJOR_VERSION; + return (unsigned int)C_VERSION_MAJOR; } unsigned int get_minor_version() { - return (unsigned int)SCMP_MINOR_VERSION; + return (unsigned int)C_VERSION_MINOR; } unsigned int get_micro_version() { - return (unsigned int)SCMP_MICRO_VERSION; + return (unsigned int)C_VERSION_MICRO; } #endif -- 2.9.3 -- You received this message because you are subscribed to the Google Groups "libseccomp" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/d/optout.
