]> rtime.felk.cvut.cz Git - wvtest.git/commit
Fix the C API to work under OS X
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 13 Jan 2011 14:55:22 +0000 (15:55 +0100)
committerAvery Pennarun <apenwarr@gmail.com>
Tue, 18 Jan 2011 23:29:12 +0000 (15:29 -0800)
commit94df5416ec8267ca3325b0d248d7e4e904352b93
tree238280e565ce535c177f4bbc84fbf425c5096e19
parentc6e3b5f72517011b8c5c4e2edaa8a3a0a2fcb4c3
Fix the C API to work under OS X

Using variable attributes to put data structures to a separate section
doesn't work as expected under OS X. The code doesn't even compile.

This patch removes the use of variable attributes and uses instead
function attribute "constructor". The functions marked by this attribute
are called before main() similarly as C++ constructors of global
variables.

These functions are used to register all the tests defined with
WVTEST_MAIN so that we can run all of them.

Thanks to Jimmy Tang for helping with the fix.
c/wvtest.c
c/wvtest.h