import source from 1.3.40
[external/swig.git] / Examples / test-suite / threads.i
1 // This test is designed for testing wrappers in the target language in a multi-threaded environment.
2 // The most common cause for this test failing is incorrect compiler settings for a multi-threaded environment.
3
4 %module threads
5
6 %include "std_string.i"
7
8 %newobject Kerfuffle::CharString;
9
10 %inline %{
11   #include <string>
12   struct Kerfuffle {
13     std::string StdString(std::string str) {
14       return str;
15     }
16     char * CharString(const char *str) {
17       char * retstr = new char[256];
18       strcpy(retstr, str);
19       return retstr;
20     }
21   };
22 %}
23