PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

/trunk/Examples/test-suite/threads.i

#
Swig | 23 lines | 18 code | 5 blank | 0 comment | 0 complexity | 947aff777ac8d02777511ede4955eb1b MD5 | raw file
 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