Re: Build failed in Hudson: 3.HEAD-i386-opensolaris-SunStudioCc #502

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Sat, 04 Dec 2010 14:08:00 +1300

On 04/12/10 06:11, Tsantilas Christos wrote:
> Hi all,
> The problem now is mixing extern "C" functions with c++.
>
> On 12/03/2010 08:35 AM, noc_at_squid-cache.org wrote:
>> libtool: compile: ccache /opt/SunStudioExpress/prod/bin/CC
>> -DHAVE_CONFIG_H -I../../.. -I../../../include -I../../../lib
>> -I../../../src -I../../include -I/usr/local/include
>> -I/usr/include/gssapi -I/usr/include/kerberosv5 -I../../../libltdl
>> -I/usr/include/libxml2 -I/usr/include/gssapi -I/usr/include/kerberosv5
>> -I/usr/include/libxml2
>> -errwarn=%all,no%badargtype2w,no%wbadinit,no%wbadasg -errtags
>> -D_REENTRANT -D_FILE_OFFSET_BITS=64 -g -c
>> ../../../src/base/AsyncCall.cc -KPIC -DPIC -o .libs/AsyncCall.o
>> "../../../src/ssl/gadgets.h", line 38: Error, temargnoval: Template
>> parameter DeAllocator requires an expression of type void(*)(x509_st*).
>> "../../../src/ssl/gadgets.h", line 39: Error, temargnoval: Template
>> parameter DeAllocator requires an expression of type
>> void(*)(evp_pkey_st*).
>> "../../../src/ssl/gadgets.h", line 40: Error, temargnoval: Template
>> parameter DeAllocator requires an expression of type void(*)(bignum_st*).
>> "../../../src/ssl/gadgets.h", line 42: Error, temargnoval: Template
>> parameter DeAllocator requires an expression of type
>> void(*)(asn1_string_st*).
>> "../../../src/ssl/gadgets.h", line 43: Error, temargnoval: Template
>> parameter DeAllocator requires an expression of type void(*)(txt_db_st*).
>> "../../../src/ssl/gadgets.h", line 44: Error, temargnoval: Template
>> parameter DeAllocator requires an expression of type
>> void(*)(X509_name_st*).
>> "../../../src/ssl/gadgets.h", line 45: Error, temargnoval: Template
>> parameter DeAllocator requires an expression of type void(*)(rsa_st*).
>> "../../../src/ssl/gadgets.h", line 46: Error, temargnoval: Template
>> parameter DeAllocator requires an expression of type
>> void(*)(X509_req_st*).
>> "../../../src/ssl/gadgets.h", line 47: Error, temargnoval: Template
>> parameter DeAllocator requires an expression of type
>> void(*)(ssl_ctx_st*).
>> "../../../src/ssl/gadgets.h", line 48: Error, temargnoval: Template
>> parameter DeAllocator requires an expression of type void(*)(ssl_st*).
>> 10 Error(s) detected.
>
> The only way I found to solve the above is to define C++ wrappers
> functions for X509_free, EVP_PKEY_free, BIG_NUM_free etc (~ 10 wrapper
> functions)
>
> Any opinion?

If the problem is with our passed-in callback function then we need to
define them as extern "C" explicitly for the external user.

If the problem is with their header omitting extern "C" for C++ users
then we need to wrap our include inside:

#if defined(__cplusplus)
extern "C" {
#endif
#include ...
#if defined(__cplusplus)
}
#endif

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE9 or 3.1.9
   Beta testers wanted for 3.2.0.3
Received on Sat Dec 04 2010 - 01:08:20 MST

This archive was generated by hypermail 2.2.0 : Sat Dec 04 2010 - 12:00:03 MST