Revision 7abef20e8c2b6105b5f44785efefd31000553257 authored by Filip Roséen on 22 February 2016, 16:28:30 UTC, committed by Rémi Denis-Courmont on 23 February 2016, 02:21:04 UTC
The rationale behind this patch is easier to explain with a little bit
of code than in words, but one can summarize it with; "wrong linkage
used for `vlc_set_cb` when `include/vlc_plugin.h` is compiled as C++,
this fixes that".

Explanation
-----------

    extern "C" typedef void(*callback_t)();

    void cpp_func (callback_t);

Above the name `cpp_func` has C++ linkage, and its type is a C++ function
returning `void`, accepting a pointer-to-function-with-C-linkage (returning
`void` and takes no arguments).

    typedef void(*callback_t) ();

    extern "C" int c_func (callback_t);

In this example (matching the code in `include/vlc_plugin.h`), the name `c_func`
has C linkage, and its type is a C function returning `int`, accepting a
pointer-to-function-with-C++-linkage (that returns `void` and takes no
arguments).

Conclusion
----------

Since `vlc_entry_*` will be called from C, the first parameter when invoked will
be a pointer to function with C linkage---as such this patch fixes the
previously erroneous linkage.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
1 parent 785725c
History
File Mode Size
autotools
bin
compat
contrib
doc
extras
include
lib
m4
modules
po
share
src
test
.gitattributes -rw-r--r-- 73 bytes
.gitignore -rw-r--r-- 452 bytes
.mailmap -rw-r--r-- 7.0 KB
AUTHORS -rw-r--r-- 15.3 KB
COPYING -rw-r--r-- 17.7 KB
COPYING.LIB -rw-r--r-- 25.9 KB
INSTALL -rw-r--r-- 1.5 KB
Makefile.am -rw-r--r-- 67.4 KB
NEWS -rw-r--r-- 161.6 KB
README -rw-r--r-- 2.7 KB
THANKS -rw-r--r-- 5.5 KB
bootstrap -rwxr-xr-x 1.8 KB
configure.ac -rw-r--r-- 126.6 KB
make-alias -rwxr-xr-x 299 bytes

README

back to top