unittest can't have extern (C) or import?

Leandro Lucarella llucax at gmail.com
Sun Jan 27 07:54:52 PST 2008


Hi! I'm trying to do some unittest on a C bindings. First, I found I can't
use import inside a unittest block (why?). Should I polute the module with
symbols I only want for the unittest? :S

Second, and whorst, I can't specify extern (C) in the unittest. I need to
use some functions with C linking, but I can't create them inside the
unittest. Using extern (C): or extern (C) {} gives me a parse error and
extern (C) void f() {} parses OK but the extern (C) is ignored and
compiler complains about trying to use a pointer to a D linked function
where it expects a C linked function.

Is this a bug? A feature?

TIA.

PS: Using gdc 0.25 (GCC 4.1.3) debian package.

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
----------------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------------
"The Guinness Book of Records" holds the record for being the most
stolen book in public libraries


More information about the Digitalmars-d-learn mailing list