Thomas Taschauer | indoo.rs | 29 Oct 15:34 2014

Threads created for each call to a director

Hello everyone,

We're using SWIG for wrapping C++ in Java and make great use of directors in our project. Recently we discovered that a new thread is created for each and every call to a director. Granted, this does not sound too bad if you're calling directors every now and then, but we discovered this is actually quite a big problem if you're calling your director repeatedly (hundreds of times per second). For example, the Eclipse (Android) debugger seems to "give up" at some point and simply disconnects from the application.

Moreover, we're afraid creating so many threads adds quite a big overhead and might cause the application to crash at some point...

Is there any built-in feature in SWIG that deals with such a scenario? Or are we left to workaround this issue by either polling information instead of pushing it via a director / reduce the rate at which the director is called?

Have a great day
Tom

--

Thomas Taschauer
Head Of Mobile | indoo.rs
+43 660 6403133
tom <at> indoo.rs
www.indoo.rs

This email and its attachments are confidential.

------------------------------------------------------------------------------
_______________________________________________
Swig-user mailing list
Swig-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
Mathieu Malaterre | 29 Oct 09:14 2014
Picon

error CS0246: The type or namespace name `IDisposable' could not be found

Dear all,

I am the maintainer of the GDCM package. It currently uses SWIG to
generate its C# API. Some users recently reported that GDCM now fails
to build using recent SWIG 3.x release (SWIG 2.x were fine). The error
is:

TagSetType.cs(11,27): error CS0246: The type or namespace name
`IDisposable' could not be found. Are you missing `System' using
directive?

Where:

[...]
$ head -12 ./Wrapping/Csharp/TagSetType.cs
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 3.0.2
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * -----------------------------------------------------------------------------
*/

namespace gdcm {

public class TagSetType : IDisposable
#if SWIG_DOTNET_3
[...]

My question is:

- Should I add the missing `using System` using swig macros ?
- Is there a documentation for migrating from swig 2.x to swig 3.x ?

Thanks much,

ref: https://github.com/malaterre/GDCM/issues/10

------------------------------------------------------------------------------
Witold E Wolski | 28 Oct 17:18 2014
Picon

How to tell SWIG not to wrap a member function

I have a class, which has a member function which I do not want to
have automatically wrapped to java.

Is there a way to tell swig not to wrap this function?

--

-- 
Witold Eryk Wolski

------------------------------------------------------------------------------
Thorsten Jolitz | 28 Oct 12:27 2014
Picon

Syntax error when parsing Rinternals.h


Hi List, 

when running 

#+BEGIN_SRC shell  
$ swig -cffi -c++ Rinternals.i
#+END_SRC

I get 

,----
| /usr/include/R/Rinternals.h:645: Error: Syntax error in input(1).
`----

with Rinternals.i looking like this

#+BEGIN_SWIG
%module Rinternals                                                                                
%{                                                                                             
/* Includes the header in the wrapper code */                                                  
#include "/usr/include/R/Rinternals.h"                                                                                                                                                
%}                                                                                             

/* Parse the header file to generate wrappers */                                               
%include "/usr/include/R/Rinternals.h"
#+END_SWIG

and line 645 in Rinternals.h showing

#+BEGIN_SRC C  
/* Evaluation Environment */
LibExtern SEXP	R_GlobalEnv;	    /* The "global" environment */

LibExtern SEXP  R_EmptyEnv;	    /* An empty environment at the root of the
				    	environment tree */
[...]
#+END_SRC

Is there a simple way to fix this?

--

-- 
cheers,
Thorsten

------------------------------------------------------------------------------
Paul Silvis | 27 Oct 23:19 2014
Picon
Picon

Swig/C++ unresolved python externals such as __Py_NotImplementedStruct

I'm trying to wrap an existing dll that references other dlls.  I'm using
Visual Studio 2013 and Python27 (32 bit).  When I get to the linker it
complains about unresolved externals:

__Py_NotImplementedStruct
_PyBool_Type
_PyFloat_Type
_PyClass_Type

... and so on.  I know that other Python symbols _are_ being found
(Python27\libs\python27.lib is a linker input, and the /verbose mode shows
me all sorts of symbols being found there), but don't understand where these
should come from. 

Any ideas?

Many thanks,
Paul

--
View this message in context: http://swig.10945.n7.nabble.com/Swig-C-unresolved-python-externals-such-as-Py-NotImplementedStruct-tp14042.html
Sent from the swig-user mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Daniele Nicolodi | 27 Oct 11:30 2014
Picon

BUG: -python -keywords -builtin and std::vector do not mix

Hello,

I'm using swig 2.0.12, and I'm trying to compile Python wrappers for a
sdt::vector class with the -builtin and -keyword options.  However, I
haven't found a way to make it work.

When I specify the -keyword option alone I get a number of warning about
the fact that keyword argument cannot be used with overloaded methods,
but the generated code compiles and works as expected, as least as far
as I tested it.

However, when I add the -bultin option, the generated code fails to
compile.  The swig interface file I'm using for testing this is as
simple as:

  %module vector
  %include "std_vector.i"
  %template(intvec) std::vector<int>;

compiled as:

  $(SWIG) $(SWIGFLAGS) $(BUILTIN) vector.i
  gcc -fPIC -c vector_wrap.cxx -I/usr/include/python2.7/
  g++ -shared vector_wrap.o -o _vector.so

and the compilation errors are:

> gcc -fPIC -c vector_wrap.cxx -I/usr/include/python2.7/
> vector_wrap.cxx: In function 'PyObject* _wrap_SwigPyIterator___iadd___closure(PyObject*, PyObject*)':
> vector_wrap.cxx:2969:30: error: too few arguments to function 'PyObject*
_wrap_SwigPyIterator___iadd__(PyObject*, PyObject*, PyObject*)'
>      result = wrapper(a, tuple);   \
>                               ^
> vector_wrap.cxx:5717:1: note: in expansion of macro 'SWIGPY_BINARYFUNC_CLOSURE'
>  SWIGPY_BINARYFUNC_CLOSURE(_wrap_SwigPyIterator___iadd__)
>  ^
> vector_wrap.cxx:5674:22: note: declared here
>  SWIGINTERN PyObject *_wrap_SwigPyIterator___iadd__(PyObject *self, PyObject *args, PyObject
*kwargs) {
>                       ^
> vector_wrap.cxx: In function 'PyObject* _wrap_SwigPyIterator___isub___closure(PyObject*, PyObject*)':
> vector_wrap.cxx:2969:30: error: too few arguments to function 'PyObject*
_wrap_SwigPyIterator___isub__(PyObject*, PyObject*, PyObject*)'
>      result = wrapper(a, tuple);   \
>                               ^
> vector_wrap.cxx:5762:1: note: in expansion of macro 'SWIGPY_BINARYFUNC_CLOSURE'
>  SWIGPY_BINARYFUNC_CLOSURE(_wrap_SwigPyIterator___isub__)
>  ^
> vector_wrap.cxx:5719:22: note: declared here
>  SWIGINTERN PyObject *_wrap_SwigPyIterator___isub__(PyObject *self, PyObject *args, PyObject
*kwargs) {
>                       ^
> vector_wrap.cxx: In function 'PyObject* _wrap_SwigPyIterator___add___closure(PyObject*, PyObject*)':
> vector_wrap.cxx:2969:30: error: too few arguments to function 'PyObject*
_wrap_SwigPyIterator___add__(PyObject*, PyObject*, PyObject*)'
>      result = wrapper(a, tuple);   \
>                               ^
> vector_wrap.cxx:5807:1: note: in expansion of macro 'SWIGPY_BINARYFUNC_CLOSURE'
>  SWIGPY_BINARYFUNC_CLOSURE(_wrap_SwigPyIterator___add__)
>  ^
> vector_wrap.cxx:5764:22: note: declared here
>  SWIGINTERN PyObject *_wrap_SwigPyIterator___add__(PyObject *self, PyObject *args, PyObject
*kwargs) {
>                       ^
> vector_wrap.cxx: In function 'PyObject*
SwigPyBuiltin__swig__SwigPyIterator_richcompare(PyObject*, PyObject*, int)':
> vector_wrap.cxx:7720:66: error: too few arguments to function 'PyObject*
_wrap_SwigPyIterator___eq__(PyObject*, PyObject*, PyObject*)'
>      case Py_EQ : result = _wrap_SwigPyIterator___eq__(self, tuple); break;
>                                                                   ^
> vector_wrap.cxx:5602:22: note: declared here
>  SWIGINTERN PyObject *_wrap_SwigPyIterator___eq__(PyObject *self, PyObject *args, PyObject
*kwargs) {
>                       ^
> vector_wrap.cxx:7721:66: error: too few arguments to function 'PyObject*
_wrap_SwigPyIterator___ne__(PyObject*, PyObject*, PyObject*)'
>      case Py_NE : result = _wrap_SwigPyIterator___ne__(self, tuple); break;
>                                                                   ^
> vector_wrap.cxx:5638:22: note: declared here
>  SWIGINTERN PyObject *_wrap_SwigPyIterator___ne__(PyObject *self, PyObject *args, PyObject
*kwargs) {
>                       ^

There is any solution / workaround?

Cheers,
Daniele

------------------------------------------------------------------------------
Shriramana Sharma | 25 Oct 16:16 2014
Picon

Generating C wrapper for C++ code?

Hello. Is it possible to use SWIG to automatically generate C wrapper
for C++ code?

In http://www.swig.org/guilty.html I see words like C target language
backend/module so C also seems to be supported as a target language.
However after having compiled/installed latest SWIG 3.0.2 and running
swig -help I see no option to produce C language target code.

I'm totally new to this stuff so please pardon my ignorance. Thanks!

--

-- 
Shriramana Sharma ஶ்ரீரமணஶர்மா श्रीरमणशर्मा

------------------------------------------------------------------------------
_______________________________________________
Swig-user mailing list
Swig-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
Denis Menshikov | 24 Oct 11:23 2014
Picon

not compiled example_wrap.c in FreeBSD 10

Good day,

I want to use library functions libvmmapi.so in FreeBSD (FreeBSD vmserver 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014 root <at> snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64). There is source code library (a list of files-Makefile vmmapi.h vmmapi.c vmmapi_freebsd.c) 

my actions:

user# swig3.0 -module libvmmapi -perl5 vmmapi.h

user# ls

Makefile                 vmmapi.h
libvmmapi.pm        vmmapi_freebsd.c
vmmapi.c               vmmapi_wrap.c

user# make
user# ls

Makefile                  vmmapi.o
libvmmapi.a            vmmapi.po
libvmmapi.pm         vmmapi_freebsd.c
libvmmapi_p.a         vmmapi_freebsd.o
vmmapi.c                vmmapi_freebsd.po
vmmapi.h                vmmapi_wrap.c

user# clang -fPIC -c vmmapi_wrap.c -I/usr/local/lib/perl5/5.16/mach/CORE -Dbool=char

vmmapi_wrap.c:1873:19: warning: implicit declaration of
function 'vm_create' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_create((char const *)arg1);
^
vmmapi_wrap.c:1902:30: warning: implicit declaration of
function 'vm_open' is invalid in C99
[-Wimplicit-function-declaration]
result = (struct vmctx *)vm_open((char const *)arg1);
^
vmmapi_wrap.c:1902:14: warning: cast to 'struct vmctx *' from
smaller integer type 'int' [-Wint-to-pointer-cast]
result = (struct vmctx *)vm_open((char const *)arg1);
^
vmmapi_wrap.c:1929:5: warning: implicit declaration of
function 'vm_destroy' is invalid in C99
[-Wimplicit-function-declaration]
vm_destroy(arg1);
^
vmmapi_wrap.c:1966:19: warning: implicit declaration of
function 'vm_parse_memsize' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_parse_memsize((char const *)arg1,arg2);
^
vmmapi_wrap.c:2026:19: warning: implicit declaration of
function 'vm_get_memory_seg' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_get_memory_seg(arg1,arg2,arg3,arg4);
^
vmmapi_wrap.c:2045:24: error: variable has incomplete type
'enum vm_mmap_style'
enum vm_mmap_style arg3 ;
^
vmmapi_wrap.c:2045:10: note: forward declaration of 'enum
vm_mmap_style'
enum vm_mmap_style arg3 ;
^
vmmapi_wrap.c:2073:12: error: cast to incomplete type 'enum
vm_mmap_style'
arg3 = (enum vm_mmap_style)(val3);
^
vmmapi_wrap.c:2045:10: note: forward declaration of 'enum
vm_mmap_style'
enum vm_mmap_style arg3 ;
^
vmmapi_wrap.c:2074:19: warning: implicit declaration of
function 'vm_setup_memory' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_setup_memory(arg1,arg2,arg3);
^
vmmapi_wrap.c:2128:22: warning: implicit declaration of
function 'vm_map_gpa' is invalid in C99
[-Wimplicit-function-declaration]
result = (void *)vm_map_gpa(arg1,arg2,arg3);
^
vmmapi_wrap.c:2128:14: warning: cast to 'void *' from smaller
integer type 'int' [-Wint-to-pointer-cast]
result = (void *)vm_map_gpa(arg1,arg2,arg3);
^
vmmapi_wrap.c:2188:19: warning: implicit declaration of
function 'vm_get_gpa_pmap' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_get_gpa_pmap(arg1,arg2,arg3,arg4);
^
vmmapi_wrap.c:2220:14: warning: implicit declaration of
function 'vm_get_lowmem_limit' is invalid in C99
[-Wimplicit-function-declaration]
result = vm_get_lowmem_limit(arg1);
^
vmmapi_wrap.c:2261:5: warning: implicit declaration of
function 'vm_set_lowmem_limit' is invalid in C99
[-Wimplicit-function-declaration]
vm_set_lowmem_limit(arg1,arg2);
^
vmmapi_wrap.c:2347:19: warning: implicit declaration of
function 'vm_set_desc' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_set_desc(arg1,arg2,arg3,arg4,arg5,arg6);
^
vmmapi_wrap.c:2419:19: warning: implicit declaration of
function 'vm_get_desc' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_get_desc(arg1,arg2,arg3,arg4,arg5,arg6);
^
vmmapi_wrap.c:2487:19: warning: implicit declaration of
function 'vm_set_register' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_set_register(arg1,arg2,arg3,arg4);
^
vmmapi_wrap.c:2543:19: warning: implicit declaration of
function 'vm_get_register' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_get_register(arg1,arg2,arg3,arg4);
^
vmmapi_wrap.c:2607:19: warning: implicit declaration of
function 'vm_run' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_run(arg1,arg2,arg3,arg4);
^
vmmapi_wrap.c:2647:19: warning: implicit declaration of
function 'vm_apicid2vcpu' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_apicid2vcpu(arg1,arg2);
^
vmmapi_wrap.c:2664:24: error: variable has incomplete type
'enum vm_event_type'
enum vm_event_type arg3 ;
^
vmmapi_wrap.c:2664:10: note: forward declaration of 'enum
vm_event_type'
enum vm_event_type arg3 ;
^
vmmapi_wrap.c:2695:12: error: cast to incomplete type 'enum
vm_event_type'
arg3 = (enum vm_event_type)(val3);
^
vmmapi_wrap.c:2664:10: note: forward declaration of 'enum
vm_event_type'
enum vm_event_type arg3 ;
^
vmmapi_wrap.c:2701:19: warning: implicit declaration of
function 'vm_inject_event' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_inject_event(arg1,arg2,arg3,arg4);
^
vmmapi_wrap.c:2722:24: error: variable has incomplete type
'enum vm_event_type'
enum vm_event_type arg3 ;
^
vmmapi_wrap.c:2722:10: note: forward declaration of 'enum
vm_event_type'
enum vm_event_type arg3 ;
^
vmmapi_wrap.c:2756:12: error: cast to incomplete type 'enum
vm_event_type'
arg3 = (enum vm_event_type)(val3);
^
vmmapi_wrap.c:2722:10: note: forward declaration of 'enum
vm_event_type'
enum vm_event_type arg3 ;
^
vmmapi_wrap.c:2767:19: warning: implicit declaration of
function 'vm_inject_event2' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_inject_event2(arg1,arg2,arg3,arg4,arg5);
^
vmmapi_wrap.c:2819:19: warning: implicit declaration of
function 'vm_lapic_irq' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_lapic_irq(arg1,arg2,arg3);
^
vmmapi_wrap.c:2859:19: warning: implicit declaration of
function 'vm_inject_nmi' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_inject_nmi(arg1,arg2);
^
vmmapi_wrap.c:2890:19: warning: implicit declaration of
function 'vm_capability_name2type' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_capability_name2type((char cons...
^
vmmapi_wrap.c:2918:22: warning: implicit declaration of
function 'vm_capability_type2name' is invalid in C99
[-Wimplicit-function-declaration]
result = (char *)vm_capability_type2name(arg1);
^
vmmapi_wrap.c:2918:14: warning: cast to 'char *' from smaller
integer type 'int' [-Wint-to-pointer-cast]
result = (char *)vm_capability_type2name(arg1);
^
vmmapi_wrap.c:2933:22: error: variable has incomplete type
'enum vm_cap_type'
enum vm_cap_type arg3 ;
^
vmmapi_wrap.c:2933:10: note: forward declaration of
'enum vm_cap_type'
enum vm_cap_type arg3 ;
^
vmmapi_wrap.c:2964:12: error: cast to incomplete type
'enum vm_cap_type'
arg3 = (enum vm_cap_type)(val3);
^
vmmapi_wrap.c:2933:10: note: forward declaration of
'enum vm_cap_type'
enum vm_cap_type arg3 ;
^
vmmapi_wrap.c:2970:19: warning: implicit declaration of
function 'vm_get_capability' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_get_capability(arg1,arg2,arg3,arg4);
^
vmmapi_wrap.c:2991:22: error: variable has incomplete type
'enum vm_cap_type'
enum vm_cap_type arg3 ;
^
vmmapi_wrap.c:2991:10: note: forward declaration of
'enum vm_cap_type'
enum vm_cap_type arg3 ;
^
vmmapi_wrap.c:3022:12: error: cast to incomplete type
'enum vm_cap_type'
arg3 = (enum vm_cap_type)(val3);
^
vmmapi_wrap.c:2991:10: note: forward declaration of
'enum vm_cap_type'
enum vm_cap_type arg3 ;
^
vmmapi_wrap.c:3028:19: warning: implicit declaration of
function 'vm_set_capability' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_set_capability(arg1,arg2,arg3,arg4);
^
vmmapi_wrap.c:3086:19: warning: implicit declaration of
function 'vm_assign_pptdev' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_assign_pptdev(arg1,arg2,arg3,arg4);
^
vmmapi_wrap.c:3144:19: warning: implicit declaration of
function 'vm_unassign_pptdev' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_unassign_pptdev(arg1,arg2,arg3,arg4);
^
vmmapi_wrap.c:3238:19: warning: implicit declaration of
function 'vm_map_pptdev_mmio' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_map_pptdev_mmio(arg1,arg2,arg3,a...
^
vmmapi_wrap.c:3330:19: warning: implicit declaration of
function 'vm_setup_msi' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_setup_msi(arg1,arg2,arg3,arg4,ar...
^
vmmapi_wrap.c:3454:19: warning: implicit declaration of
function 'vm_setup_msix' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_setup_msix(arg1,arg2,arg3,arg4,a...
^
vmmapi_wrap.c:3516:26: warning: implicit declaration of
function 'vm_get_stats' is invalid in C99
[-Wimplicit-function-declaration]
result = (uint64_t *)vm_get_stats(arg1,arg2,arg3,arg4);
^
vmmapi_wrap.c:3516:14: warning: cast to 'uint64_t *' (aka
'unsigned long *') from smaller integer type 'int'
[-Wint-to-pointer-cast]
result = (uint64_t *)vm_get_stats(arg1,arg2,arg3,arg4);
^
vmmapi_wrap.c:3558:22: warning: implicit declaration of
function 'vm_get_stat_desc' is invalid in C99
[-Wimplicit-function-declaration]
result = (char *)vm_get_stat_desc(arg1,arg2);
^
vmmapi_wrap.c:3558:14: warning: cast to 'char *' from smaller
integer type 'int' [-Wint-to-pointer-cast]
result = (char *)vm_get_stat_desc(arg1,arg2);
^
vmmapi_wrap.c:3604:19: warning: implicit declaration of
function 'vm_get_x2apic_state' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_get_x2apic_state(arg1,arg2,arg3);
^
vmmapi_wrap.c:3623:23: error: variable has incomplete type
'enum x2apic_state'
enum x2apic_state arg3 ;
^
vmmapi_wrap.c:3623:10: note: forward declaration of
'enum x2apic_state'
enum x2apic_state arg3 ;
^
vmmapi_wrap.c:3651:12: error: cast to incomplete type
'enum x2apic_state'
arg3 = (enum x2apic_state)(val3);
^
vmmapi_wrap.c:3623:10: note: forward declaration of
'enum x2apic_state'
enum x2apic_state arg3 ;
^
vmmapi_wrap.c:3652:19: warning: implicit declaration of
function 'vm_set_x2apic_state' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_set_x2apic_state(arg1,arg2,arg3);
^
vmmapi_wrap.c:3692:19: warning: implicit declaration of
function 'vcpu_reset' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vcpu_reset(arg1,arg2);
^
vmmapi_wrap.c:3786:19: warning: implicit declaration of
function 'vm_setup_freebsd_registers' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_setup_freebsd_registers(arg1,arg...
^
vmmapi_wrap.c:3815:5: warning: implicit declaration of
function 'vm_setup_freebsd_gdt' is invalid in C99
[-Wimplicit-function-declaration]
vm_setup_freebsd_gdt(arg1);
^
vmmapi_wrap.c:4229:61: error: use of undeclared identifier
'VM_MMAP_NONE'
...SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(VM_MMAP_NO...
^
vmmapi_wrap.c:913:80: note: expanded from macro
'SWIG_PERL_CALL_ARGS_1'
...(SWIG_PERL_OBJECT_CALL arg1)
^
/usr/local/lib/perl5/5.16/mach/CORE/sv.h:1851:22: note:
expanded from macro 'sv_setsv'
sv_setsv_flags(dsv, ssv, SV_GMAGIC|SV_DO_COW_SVSETSV)
^
/usr/local/lib/perl5/5.16/mach/CORE/embed.h:628:59: note:
expanded from macro 'sv_setsv_flags'
...Perl_sv_setsv_flags(aTHX_ a,b,c)
^
vmmapi_wrap.c:4234:61: error: use of undeclared identifier
'VM_MMAP_ALL'
...SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(VM_MMAP_AL...
^
vmmapi_wrap.c:913:80: note: expanded from macro
'SWIG_PERL_CALL_ARGS_1'
...(SWIG_PERL_OBJECT_CALL arg1)
^
/usr/local/lib/perl5/5.16/mach/CORE/sv.h:1851:22: note:
expanded from macro 'sv_setsv'
sv_setsv_flags(dsv, ssv, SV_GMAGIC|SV_DO_COW_SVSETSV)
^
/usr/local/lib/perl5/5.16/mach/CORE/embed.h:628:59: note:
expanded from macro 'sv_setsv_flags'
...Perl_sv_setsv_flags(aTHX_ a,b,c)
^
vmmapi_wrap.c:4239:61: error: use of undeclared identifier
'VM_MMAP_SPARSE'
...SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(VM_MMAP_SP...
^
vmmapi_wrap.c:913:80: note: expanded from macro
'SWIG_PERL_CALL_ARGS_1'
...(SWIG_PERL_OBJECT_CALL arg1)
^
/usr/local/lib/perl5/5.16/mach/CORE/sv.h:1851:22: note:
expanded from macro 'sv_setsv'
sv_setsv_flags(dsv, ssv, SV_GMAGIC|SV_DO_COW_SVSETSV)
^
/usr/local/lib/perl5/5.16/mach/CORE/embed.h:628:59: note:
expanded from macro 'sv_setsv_flags'
...Perl_sv_setsv_flags(aTHX_ a,b,c)
^
41 warnings and 15 errors generated.
vmmapi.h:48:42: error: unknown type name 'size_t'
int vm_parse_memsize(const char *optarg, size_t *...
^
vmmapi.h:49:42: error: unknown type name 'vm_paddr_t'
int vm_get_memory_seg(struct vmctx *ctx, vm_paddr...
^
vmmapi.h:49:58: error: unknown type name 'size_t'
...vmctx *ctx, vm_paddr_t gpa, size_t *ret_len,
^
vmmapi.h:51:40: error: unknown type name 'size_t'
int vm_setup_memory(struct vmctx *ctx, size_t len...
^
vmmapi.h:52:37: error: unknown type name 'vm_paddr_t'
void *vm_map_gpa(struct vmctx *ctx, vm_paddr_t gad...
^
vmmapi.h:52:55: error: unknown type name 'size_t'
...vmctx *ctx, vm_paddr_t gaddr, size_t len);
^
vmmapi.h:53:37: error: unknown type name 'uint64_t'
int vm_get_gpa_pmap(struct vmctx *, uint64_t gpa...
^
vmmapi.h:53:51: error: unknown type name 'uint64_t'
int vm_get_gpa_pmap(struct vmctx *, uint64_t gpa, uint64_...
^
vmmapi.h:54:1: error: unknown type name 'uint32_t'
uint32_t vm_get_lowmem_limit(struct vmctx *ctx);
^
vmmapi.h:55:45: error: unknown type name 'uint32_t'
void vm_set_lowmem_limit(struct vmctx *ctx, uint32...
^
vmmapi.h:57:7: error: unknown type name 'uint64_t'
uint64_t base, uint32_t limit, ui...
^
vmmapi.h:57:22: error: unknown type name 'uint32_t'
uint64_t base, uint32_t limit, ui...
^
vmmapi.h:57:38: error: unknown type name 'uint32_t'
...uint64_t base, uint32_t limit, uint32_t access);
^
vmmapi.h:59:7: error: unknown type name 'uint64_t'
uint64_t *base, uint32_t *limit, ...
^
vmmapi.h:59:23: error: unknown type name 'uint32_t'
uint64_t *base, uint32_t *limit, ...
^
vmmapi.h:59:40: error: unknown type name 'uint32_t'
...uint64_t *base, uint32_t *limit, uint32_t *access);
^
vmmapi.h:60:59: error: unknown type name 'uint64_t'
...vmctx *ctx, int vcpu, int reg, uint64_t val);
^
vmmapi.h:61:59: error: unknown type name 'uint64_t'
...vmctx *ctx, int vcpu, int reg, uint64_t *retval);
^
vmmapi.h:62:41: error: unknown type name 'uint64_t'
int vm_run(struct vmctx *ctx, int vcpu, uint64_t rip,
^
vmmapi.h:63:16: warning: declaration of 'struct vm_exit' will
not be visible outside of this function [-Wvisibility]
struct vm_exit *ret_vmexit);
^
vmmapi.h:65:55: warning: declaration of 'enum vm_event_type'
will not be visible outside of this function
[-Wvisibility]
...vmctx *ctx, int vcpu, enum vm_event_type type,
^
vmmapi.h:67:56: warning: declaration of 'enum vm_event_type'
will not be visible outside of this function
[-Wvisibility]
...vmctx *ctx, int vcpu, enum vm_event_type type,
^
vmmapi.h:73:57: warning: declaration of 'enum vm_cap_type'
will not be visible outside of this function
[-Wvisibility]
...vmctx *ctx, int vcpu, enum vm_cap_type cap,
^
vmmapi.h:75:57: warning: declaration of 'enum vm_cap_type'
will not be visible outside of this function
[-Wvisibility]
...vmctx *ctx, int vcpu, enum vm_cap_type cap,
^
fatal error: too many errors emitted, stopping now
[-ferror-limit=]



What I do is not right? Thank you.



--
С уважением Denis Menshikov


--
С уважением Denis Menshikov
------------------------------------------------------------------------------
_______________________________________________
Swig-user mailing list
Swig-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
Denis Menshikov | 24 Oct 11:14 2014
Picon

(no subject)

Good day,

I want to use library functions libvmmapi.so in FreeBSD (FreeBSD vmserver 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014 root <at> snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64). There is source code library (a list of files-Makefile vmmapi.h vmmapi.c vmmapi_freebsd.c) 

my actions:

user# swig3.0 -module libvmmapi -perl5 vmmapi.h

user# ls

Makefile                 vmmapi.h
libvmmapi.pm        vmmapi_freebsd.c
vmmapi.c               vmmapi_wrap.c

user# make
user# ls

Makefile                  vmmapi.o
libvmmapi.a            vmmapi.po
libvmmapi.pm         vmmapi_freebsd.c
libvmmapi_p.a         vmmapi_freebsd.o
vmmapi.c                vmmapi_freebsd.po
vmmapi.h                vmmapi_wrap.c

user# clang -fPIC -c vmmapi_wrap.c -I/usr/local/lib/perl5/5.16/mach/CORE -Dbool=char

vmmapi_wrap.c:1873:19: warning: implicit declaration of
function 'vm_create' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_create((char const *)arg1);
^
vmmapi_wrap.c:1902:30: warning: implicit declaration of
function 'vm_open' is invalid in C99
[-Wimplicit-function-declaration]
result = (struct vmctx *)vm_open((char const *)arg1);
^
vmmapi_wrap.c:1902:14: warning: cast to 'struct vmctx *' from
smaller integer type 'int' [-Wint-to-pointer-cast]
result = (struct vmctx *)vm_open((char const *)arg1);
^
vmmapi_wrap.c:1929:5: warning: implicit declaration of
function 'vm_destroy' is invalid in C99
[-Wimplicit-function-declaration]
vm_destroy(arg1);
^
vmmapi_wrap.c:1966:19: warning: implicit declaration of
function 'vm_parse_memsize' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_parse_memsize((char const *)arg1,arg2);
^
vmmapi_wrap.c:2026:19: warning: implicit declaration of
function 'vm_get_memory_seg' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_get_memory_seg(arg1,arg2,arg3,arg4);
^
vmmapi_wrap.c:2045:24: error: variable has incomplete type
'enum vm_mmap_style'
enum vm_mmap_style arg3 ;
^
vmmapi_wrap.c:2045:10: note: forward declaration of 'enum
vm_mmap_style'
enum vm_mmap_style arg3 ;
^
vmmapi_wrap.c:2073:12: error: cast to incomplete type 'enum
vm_mmap_style'
arg3 = (enum vm_mmap_style)(val3);
^
vmmapi_wrap.c:2045:10: note: forward declaration of 'enum
vm_mmap_style'
enum vm_mmap_style arg3 ;
^
vmmapi_wrap.c:2074:19: warning: implicit declaration of
function 'vm_setup_memory' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_setup_memory(arg1,arg2,arg3);
^
vmmapi_wrap.c:2128:22: warning: implicit declaration of
function 'vm_map_gpa' is invalid in C99
[-Wimplicit-function-declaration]
result = (void *)vm_map_gpa(arg1,arg2,arg3);
^
vmmapi_wrap.c:2128:14: warning: cast to 'void *' from smaller
integer type 'int' [-Wint-to-pointer-cast]
result = (void *)vm_map_gpa(arg1,arg2,arg3);
^
vmmapi_wrap.c:2188:19: warning: implicit declaration of
function 'vm_get_gpa_pmap' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_get_gpa_pmap(arg1,arg2,arg3,arg4);
^
vmmapi_wrap.c:2220:14: warning: implicit declaration of
function 'vm_get_lowmem_limit' is invalid in C99
[-Wimplicit-function-declaration]
result = vm_get_lowmem_limit(arg1);
^
vmmapi_wrap.c:2261:5: warning: implicit declaration of
function 'vm_set_lowmem_limit' is invalid in C99
[-Wimplicit-function-declaration]
vm_set_lowmem_limit(arg1,arg2);
^
vmmapi_wrap.c:2347:19: warning: implicit declaration of
function 'vm_set_desc' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_set_desc(arg1,arg2,arg3,arg4,arg5,arg6);
^
vmmapi_wrap.c:2419:19: warning: implicit declaration of
function 'vm_get_desc' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_get_desc(arg1,arg2,arg3,arg4,arg5,arg6);
^
vmmapi_wrap.c:2487:19: warning: implicit declaration of
function 'vm_set_register' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_set_register(arg1,arg2,arg3,arg4);
^
vmmapi_wrap.c:2543:19: warning: implicit declaration of
function 'vm_get_register' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_get_register(arg1,arg2,arg3,arg4);
^
vmmapi_wrap.c:2607:19: warning: implicit declaration of
function 'vm_run' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_run(arg1,arg2,arg3,arg4);
^
vmmapi_wrap.c:2647:19: warning: implicit declaration of
function 'vm_apicid2vcpu' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_apicid2vcpu(arg1,arg2);
^
vmmapi_wrap.c:2664:24: error: variable has incomplete type
'enum vm_event_type'
enum vm_event_type arg3 ;
^
vmmapi_wrap.c:2664:10: note: forward declaration of 'enum
vm_event_type'
enum vm_event_type arg3 ;
^
vmmapi_wrap.c:2695:12: error: cast to incomplete type 'enum
vm_event_type'
arg3 = (enum vm_event_type)(val3);
^
vmmapi_wrap.c:2664:10: note: forward declaration of 'enum
vm_event_type'
enum vm_event_type arg3 ;
^
vmmapi_wrap.c:2701:19: warning: implicit declaration of
function 'vm_inject_event' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_inject_event(arg1,arg2,arg3,arg4);
^
vmmapi_wrap.c:2722:24: error: variable has incomplete type
'enum vm_event_type'
enum vm_event_type arg3 ;
^
vmmapi_wrap.c:2722:10: note: forward declaration of 'enum
vm_event_type'
enum vm_event_type arg3 ;
^
vmmapi_wrap.c:2756:12: error: cast to incomplete type 'enum
vm_event_type'
arg3 = (enum vm_event_type)(val3);
^
vmmapi_wrap.c:2722:10: note: forward declaration of 'enum
vm_event_type'
enum vm_event_type arg3 ;
^
vmmapi_wrap.c:2767:19: warning: implicit declaration of
function 'vm_inject_event2' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_inject_event2(arg1,arg2,arg3,arg4,arg5);
^
vmmapi_wrap.c:2819:19: warning: implicit declaration of
function 'vm_lapic_irq' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_lapic_irq(arg1,arg2,arg3);
^
vmmapi_wrap.c:2859:19: warning: implicit declaration of
function 'vm_inject_nmi' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_inject_nmi(arg1,arg2);
^
vmmapi_wrap.c:2890:19: warning: implicit declaration of
function 'vm_capability_name2type' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_capability_name2type((char cons...
^
vmmapi_wrap.c:2918:22: warning: implicit declaration of
function 'vm_capability_type2name' is invalid in C99
[-Wimplicit-function-declaration]
result = (char *)vm_capability_type2name(arg1);
^
vmmapi_wrap.c:2918:14: warning: cast to 'char *' from smaller
integer type 'int' [-Wint-to-pointer-cast]
result = (char *)vm_capability_type2name(arg1);
^
vmmapi_wrap.c:2933:22: error: variable has incomplete type
'enum vm_cap_type'
enum vm_cap_type arg3 ;
^
vmmapi_wrap.c:2933:10: note: forward declaration of
'enum vm_cap_type'
enum vm_cap_type arg3 ;
^
vmmapi_wrap.c:2964:12: error: cast to incomplete type
'enum vm_cap_type'
arg3 = (enum vm_cap_type)(val3);
^
vmmapi_wrap.c:2933:10: note: forward declaration of
'enum vm_cap_type'
enum vm_cap_type arg3 ;
^
vmmapi_wrap.c:2970:19: warning: implicit declaration of
function 'vm_get_capability' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_get_capability(arg1,arg2,arg3,arg4);
^
vmmapi_wrap.c:2991:22: error: variable has incomplete type
'enum vm_cap_type'
enum vm_cap_type arg3 ;
^
vmmapi_wrap.c:2991:10: note: forward declaration of
'enum vm_cap_type'
enum vm_cap_type arg3 ;
^
vmmapi_wrap.c:3022:12: error: cast to incomplete type
'enum vm_cap_type'
arg3 = (enum vm_cap_type)(val3);
^
vmmapi_wrap.c:2991:10: note: forward declaration of
'enum vm_cap_type'
enum vm_cap_type arg3 ;
^
vmmapi_wrap.c:3028:19: warning: implicit declaration of
function 'vm_set_capability' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_set_capability(arg1,arg2,arg3,arg4);
^
vmmapi_wrap.c:3086:19: warning: implicit declaration of
function 'vm_assign_pptdev' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_assign_pptdev(arg1,arg2,arg3,arg4);
^
vmmapi_wrap.c:3144:19: warning: implicit declaration of
function 'vm_unassign_pptdev' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_unassign_pptdev(arg1,arg2,arg3,arg4);
^
vmmapi_wrap.c:3238:19: warning: implicit declaration of
function 'vm_map_pptdev_mmio' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_map_pptdev_mmio(arg1,arg2,arg3,a...
^
vmmapi_wrap.c:3330:19: warning: implicit declaration of
function 'vm_setup_msi' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_setup_msi(arg1,arg2,arg3,arg4,ar...
^
vmmapi_wrap.c:3454:19: warning: implicit declaration of
function 'vm_setup_msix' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_setup_msix(arg1,arg2,arg3,arg4,a...
^
vmmapi_wrap.c:3516:26: warning: implicit declaration of
function 'vm_get_stats' is invalid in C99
[-Wimplicit-function-declaration]
result = (uint64_t *)vm_get_stats(arg1,arg2,arg3,arg4);
^
vmmapi_wrap.c:3516:14: warning: cast to 'uint64_t *' (aka
'unsigned long *') from smaller integer type 'int'
[-Wint-to-pointer-cast]
result = (uint64_t *)vm_get_stats(arg1,arg2,arg3,arg4);
^
vmmapi_wrap.c:3558:22: warning: implicit declaration of
function 'vm_get_stat_desc' is invalid in C99
[-Wimplicit-function-declaration]
result = (char *)vm_get_stat_desc(arg1,arg2);
^
vmmapi_wrap.c:3558:14: warning: cast to 'char *' from smaller
integer type 'int' [-Wint-to-pointer-cast]
result = (char *)vm_get_stat_desc(arg1,arg2);
^
vmmapi_wrap.c:3604:19: warning: implicit declaration of
function 'vm_get_x2apic_state' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_get_x2apic_state(arg1,arg2,arg3);
^
vmmapi_wrap.c:3623:23: error: variable has incomplete type
'enum x2apic_state'
enum x2apic_state arg3 ;
^
vmmapi_wrap.c:3623:10: note: forward declaration of
'enum x2apic_state'
enum x2apic_state arg3 ;
^
vmmapi_wrap.c:3651:12: error: cast to incomplete type
'enum x2apic_state'
arg3 = (enum x2apic_state)(val3);
^
vmmapi_wrap.c:3623:10: note: forward declaration of
'enum x2apic_state'
enum x2apic_state arg3 ;
^
vmmapi_wrap.c:3652:19: warning: implicit declaration of
function 'vm_set_x2apic_state' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_set_x2apic_state(arg1,arg2,arg3);
^
vmmapi_wrap.c:3692:19: warning: implicit declaration of
function 'vcpu_reset' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vcpu_reset(arg1,arg2);
^
vmmapi_wrap.c:3786:19: warning: implicit declaration of
function 'vm_setup_freebsd_registers' is invalid in C99
[-Wimplicit-function-declaration]
result = (int)vm_setup_freebsd_registers(arg1,arg...
^
vmmapi_wrap.c:3815:5: warning: implicit declaration of
function 'vm_setup_freebsd_gdt' is invalid in C99
[-Wimplicit-function-declaration]
vm_setup_freebsd_gdt(arg1);
^
vmmapi_wrap.c:4229:61: error: use of undeclared identifier
'VM_MMAP_NONE'
...SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(VM_MMAP_NO...
^
vmmapi_wrap.c:913:80: note: expanded from macro
'SWIG_PERL_CALL_ARGS_1'
...(SWIG_PERL_OBJECT_CALL arg1)
^
/usr/local/lib/perl5/5.16/mach/CORE/sv.h:1851:22: note:
expanded from macro 'sv_setsv'
sv_setsv_flags(dsv, ssv, SV_GMAGIC|SV_DO_COW_SVSETSV)
^
/usr/local/lib/perl5/5.16/mach/CORE/embed.h:628:59: note:
expanded from macro 'sv_setsv_flags'
...Perl_sv_setsv_flags(aTHX_ a,b,c)
^
vmmapi_wrap.c:4234:61: error: use of undeclared identifier
'VM_MMAP_ALL'
...SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(VM_MMAP_AL...
^
vmmapi_wrap.c:913:80: note: expanded from macro
'SWIG_PERL_CALL_ARGS_1'
...(SWIG_PERL_OBJECT_CALL arg1)
^
/usr/local/lib/perl5/5.16/mach/CORE/sv.h:1851:22: note:
expanded from macro 'sv_setsv'
sv_setsv_flags(dsv, ssv, SV_GMAGIC|SV_DO_COW_SVSETSV)
^
/usr/local/lib/perl5/5.16/mach/CORE/embed.h:628:59: note:
expanded from macro 'sv_setsv_flags'
...Perl_sv_setsv_flags(aTHX_ a,b,c)
^
vmmapi_wrap.c:4239:61: error: use of undeclared identifier
'VM_MMAP_SPARSE'
...SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(VM_MMAP_SP...
^
vmmapi_wrap.c:913:80: note: expanded from macro
'SWIG_PERL_CALL_ARGS_1'
...(SWIG_PERL_OBJECT_CALL arg1)
^
/usr/local/lib/perl5/5.16/mach/CORE/sv.h:1851:22: note:
expanded from macro 'sv_setsv'
sv_setsv_flags(dsv, ssv, SV_GMAGIC|SV_DO_COW_SVSETSV)
^
/usr/local/lib/perl5/5.16/mach/CORE/embed.h:628:59: note:
expanded from macro 'sv_setsv_flags'
...Perl_sv_setsv_flags(aTHX_ a,b,c)
^
41 warnings and 15 errors generated.
vmmapi.h:48:42: error: unknown type name 'size_t'
int vm_parse_memsize(const char *optarg, size_t *...
^
vmmapi.h:49:42: error: unknown type name 'vm_paddr_t'
int vm_get_memory_seg(struct vmctx *ctx, vm_paddr...
^
vmmapi.h:49:58: error: unknown type name 'size_t'
...vmctx *ctx, vm_paddr_t gpa, size_t *ret_len,
^
vmmapi.h:51:40: error: unknown type name 'size_t'
int vm_setup_memory(struct vmctx *ctx, size_t len...
^
vmmapi.h:52:37: error: unknown type name 'vm_paddr_t'
void *vm_map_gpa(struct vmctx *ctx, vm_paddr_t gad...
^
vmmapi.h:52:55: error: unknown type name 'size_t'
...vmctx *ctx, vm_paddr_t gaddr, size_t len);
^
vmmapi.h:53:37: error: unknown type name 'uint64_t'
int vm_get_gpa_pmap(struct vmctx *, uint64_t gpa...
^
vmmapi.h:53:51: error: unknown type name 'uint64_t'
int vm_get_gpa_pmap(struct vmctx *, uint64_t gpa, uint64_...
^
vmmapi.h:54:1: error: unknown type name 'uint32_t'
uint32_t vm_get_lowmem_limit(struct vmctx *ctx);
^
vmmapi.h:55:45: error: unknown type name 'uint32_t'
void vm_set_lowmem_limit(struct vmctx *ctx, uint32...
^
vmmapi.h:57:7: error: unknown type name 'uint64_t'
uint64_t base, uint32_t limit, ui...
^
vmmapi.h:57:22: error: unknown type name 'uint32_t'
uint64_t base, uint32_t limit, ui...
^
vmmapi.h:57:38: error: unknown type name 'uint32_t'
...uint64_t base, uint32_t limit, uint32_t access);
^
vmmapi.h:59:7: error: unknown type name 'uint64_t'
uint64_t *base, uint32_t *limit, ...
^
vmmapi.h:59:23: error: unknown type name 'uint32_t'
uint64_t *base, uint32_t *limit, ...
^
vmmapi.h:59:40: error: unknown type name 'uint32_t'
...uint64_t *base, uint32_t *limit, uint32_t *access);
^
vmmapi.h:60:59: error: unknown type name 'uint64_t'
...vmctx *ctx, int vcpu, int reg, uint64_t val);
^
vmmapi.h:61:59: error: unknown type name 'uint64_t'
...vmctx *ctx, int vcpu, int reg, uint64_t *retval);
^
vmmapi.h:62:41: error: unknown type name 'uint64_t'
int vm_run(struct vmctx *ctx, int vcpu, uint64_t rip,
^
vmmapi.h:63:16: warning: declaration of 'struct vm_exit' will
not be visible outside of this function [-Wvisibility]
struct vm_exit *ret_vmexit);
^
vmmapi.h:65:55: warning: declaration of 'enum vm_event_type'
will not be visible outside of this function
[-Wvisibility]
...vmctx *ctx, int vcpu, enum vm_event_type type,
^
vmmapi.h:67:56: warning: declaration of 'enum vm_event_type'
will not be visible outside of this function
[-Wvisibility]
...vmctx *ctx, int vcpu, enum vm_event_type type,
^
vmmapi.h:73:57: warning: declaration of 'enum vm_cap_type'
will not be visible outside of this function
[-Wvisibility]
...vmctx *ctx, int vcpu, enum vm_cap_type cap,
^
vmmapi.h:75:57: warning: declaration of 'enum vm_cap_type'
will not be visible outside of this function
[-Wvisibility]
...vmctx *ctx, int vcpu, enum vm_cap_type cap,
^
fatal error: too many errors emitted, stopping now
[-ferror-limit=]



What I do is not right? Thank you.



--
С уважением Denis Menshikov
------------------------------------------------------------------------------
_______________________________________________
Swig-user mailing list
Swig-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
Dmitriev K. S. | 21 Oct 22:35 2014
Picon

Currently supported V8 version

Hello,

Could you please tell me, which V8 version is supported in SWIG 3.0.2? 
My compiler refuses to process a simplest generated wrapper with the 
latest V8 headers (3.8); in particular, it complies on undefined 
'v8::String::New(...)' symbols.

Thank you.

Best regards,
Kirill

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
Sergey K. | 21 Oct 14:19 2014
Picon

Loading extra libraries before the wrapped one

Hello,

so I'm writing the Python wrappers to the C library.

What I have is C header with top-level API, shared library (lib_c.so) and its own separate build process for that library. I cannot make any changes to the library - its not my project at all.

The interface file is very simple

%module lib_c
%{
#include "lib_c.h"
%}

%include "lib_c.h"

When I generate the wrappers and compile them, I'll have two Python modules: lib_c and _lib_c. If I try to import lib_c in Python interpreter, it will try immediately to load _lib_c (which is correct behaviour, obviously). The problem here is that before that I must load the original C library lib_c.so (the one that I cannot modify).

I don't have any extra static libraries from lib_c (original C library) to link with. And unfortunately I cannot change that. But running Python like

LD_PRELOAD=lib_c.so python

would solve the problem.

So the question is - is there any possibility to add extra actions to the Python bindings so the original C library would be loaded before my wrappers (_lib_c in the example above)? Of course I could do that manually by creating extra Python modules, but I think that's kind of a weird solution.
--
BR,
Sergey Khentov
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Swig-user mailing list
Swig-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user

Gmane