"Include what you use" for tests
Using strcpy/strlen in global namespace requires `<string.h>`. Include explicitly instead of assuming another SWIG or library header brings it in.
This commit is contained in:
parent
31af3ce9bf
commit
c2c3f968df
3 changed files with 10 additions and 0 deletions
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#define BUFFER_SIZE_AA 8
|
#define BUFFER_SIZE_AA 8
|
||||||
#define BUFFER_SIZE_BB 5
|
#define BUFFER_SIZE_BB 5
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,11 @@ struct ExtendingOptArgs1 {};
|
||||||
struct ExtendingOptArgs2 {};
|
struct ExtendingOptArgs2 {};
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
// For strlen/strcpy
|
||||||
|
%{
|
||||||
|
#include <string.h>
|
||||||
|
%}
|
||||||
|
|
||||||
// Varargs
|
// Varargs
|
||||||
%warnfilter(SWIGWARN_LANG_VARARGS_KEYWORD) VarargConstructor::VarargConstructor; // Can't wrap varargs with keyword arguments enabled
|
%warnfilter(SWIGWARN_LANG_VARARGS_KEYWORD) VarargConstructor::VarargConstructor; // Can't wrap varargs with keyword arguments enabled
|
||||||
%warnfilter(SWIGWARN_LANG_VARARGS_KEYWORD) VarargConstructor::vararg_method; // Can't wrap varargs with keyword arguments enabled
|
%warnfilter(SWIGWARN_LANG_VARARGS_KEYWORD) VarargConstructor::vararg_method; // Can't wrap varargs with keyword arguments enabled
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,10 @@ void CheckRetTypemapUsed() {
|
||||||
/* hello */ delete[] result;
|
/* hello */ delete[] result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%{
|
||||||
|
#include <string.h>
|
||||||
|
%}
|
||||||
|
|
||||||
%inline {
|
%inline {
|
||||||
class FFoo {
|
class FFoo {
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue