Skip to content

Commit c041ac6

Browse files
committed
Move <string.h> fragment to swigfragments
1 parent feeb251 commit c041ac6

File tree

6 files changed

+14
-6
lines changed

6 files changed

+14
-6
lines changed

Examples/test-suite/char_strings.i

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ below.
1111

1212
%{
1313
#include <stdio.h>
14+
#include <string.h>
1415

1516
#define OTHERLAND_MSG "Little message from the safe world."
1617
#define CPLUSPLUS_MSG "A message from the deep dark world of C++, where anything is possible."
@@ -150,11 +151,11 @@ const char global_const_char_array2[sizeof(CPLUSPLUS_MSG)+1] = CPLUSPLUS_MSG;
150151
%inline {
151152
struct Formatpos;
152153
struct OBFormat;
153-
154+
154155
static int GetNextFormat(Formatpos& itr, const char*& str,OBFormat*& pFormat) {
155156
return 0;
156157
}
157-
158+
158159

159160

160161
}

Examples/test-suite/threads_exception.i

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
%}
1414

1515
%{
16+
#include <string.h>
1617
struct A {};
1718
%}
1819

Examples/test-suite/varargs.i

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
%varargs(int mode = 0) Foo::statictest(const char*fmt, ...);
88
%varargs(2, int mode = 0) test_plenty(const char*fmt, ...);
99

10+
%{
11+
#include <string.h>
12+
%}
13+
1014
%inline %{
1115
char *test(const char *fmt, ...) {
1216
return (char *) fmt;

Lib/cdata.i

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* SWIG library file containing macros for manipulating raw C data as strings.
55
* ----------------------------------------------------------------------------- */
66

7+
%include <swigfragments.swg>
8+
79
%{
810
typedef struct SWIGCDATA {
911
char *data;

Lib/swig.swg

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -442,10 +442,6 @@ namespace std {
442442
* Default char * and C array typemaps
443443
* ----------------------------------------------------------------------------- */
444444

445-
%fragment("<string.h>", "runtime") %{
446-
#include <string.h>
447-
%}
448-
449445
/* Set up the typemap for handling new return strings */
450446

451447
#ifdef __cplusplus

Lib/swigfragments.swg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
#include <math.h>
3030
%}
3131

32+
%fragment("<string.h>", "header") %{
33+
#include <string.h>
34+
%}
35+
3236
%fragment("<stddef.h>", "header") %{
3337
#include <stddef.h>
3438
%}

0 commit comments

Comments
 (0)