[Ocaml] Apply patch #3151788 from Joel Reymont. Brings Ocaml support a up to date (ver 3.11 and 3.12), including std::string.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12460 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
7d700cc999
commit
1fab53b204
9 changed files with 240 additions and 245 deletions
|
|
@ -1,14 +1,18 @@
|
|||
/* -*- mode: c++ -*- */
|
||||
/* File : example.h -- Tests all string typemaps */
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
|
||||
void takes_std_string( std::string in ) {
|
||||
cout << "takes_std_string( \"" << in << "\" );" << endl;
|
||||
}
|
||||
|
||||
std::string gives_std_string() {
|
||||
time_t t;
|
||||
|
||||
return std::string( asctime( localtime( &t ) ) );
|
||||
struct timeval tv;
|
||||
|
||||
gettimeofday(&tv, NULL);
|
||||
return std::string( asctime( localtime( &tv.tv_sec ) ) );
|
||||
}
|
||||
|
||||
void takes_char_ptr( char *p ) {
|
||||
|
|
@ -24,10 +28,10 @@ void takes_and_gives_std_string( std::string &inout ) {
|
|||
inout.insert( inout.end(), ']' );
|
||||
}
|
||||
|
||||
void takes_and_gives_char_ptr( char *&ptr ) {
|
||||
char *pout = strchr( ptr, '.' );
|
||||
if( pout ) ptr = pout + 1;
|
||||
else ptr = "foo";
|
||||
void takes_and_gives_char_ptr( char *&inout ) {
|
||||
char *pout = strchr( inout, '.' );
|
||||
if( pout ) inout = pout + 1;
|
||||
else inout = "foo";
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue