After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 599002 - Incorrect Macro Definition in sigc++config.h for MSVC
Incorrect Macro Definition in sigc++config.h for MSVC
Status: RESOLVED FIXED
Product: libsigc++
Classification: Bindings
Component: general
2.2.x
Other Windows
: Normal major
: ---
Assigned To: Martin Schulze
Martin Schulze
Depends on:
Blocks:
 
 
Reported: 2009-10-20 02:47 UTC by Fan, Chun-wei
Modified: 2010-07-08 12:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The updated sigc++config.h (2.75 KB, text/plain)
2009-10-20 02:47 UTC, Fan, Chun-wei
Details

Description Fan, Chun-wei 2009-10-20 02:47:56 UTC
Created attachment 145824 [details]
The updated sigc++config.h

I have tried to compile the 2.2.4.x versions of libsigc++ using the supplied
project files for Visual C++ 2008.  The library (DLL) itself compiled fine, but
10 of the test/sample programs did not compile (error C2951-illegal definition
of templates in functors/slot.h and others).  Going further to compile glibmm,
the compilation failed due to the same errors, and I gave up trying to compile
version 2.2.4.x and went back to version 2.2.3, as I did not find any
difference in the functors/slot.h in 2.2.3 and 2.2.4.x.

Later on, as I traced the code, it seems the supplied sigc++config.h had an
incorrect macro definition in line 5-that is 
"#define SIGC_GCC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD 1", which causes
the wrong template definition being picked up in adapter_trait.h, as that macro
is checked before the "#define
SIGC_MSVC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD 1" macro, which I believe
is the correct macro to pick up the correct template definition in
adapter_trait.h.  So, I commented line 5 out, and the entire set of project
files compiled, and as I guessed, glibmm successfully compiled against
libsigc++ 2.2.4.2.

The updated sigc++config.h is attached for reference-this fix applies for both
MSVC2005 and MSVC2008 since the file is identical on both sides.
Comment 1 frank28_nfls 2009-12-07 11:06:36 UTC
Agree! And with that patch, I can finally have codes compiled with this new version. Thanks.
Comment 2 Daniel Elstner 2009-12-14 00:23:56 UTC
Comment on attachment 145824 [details]
The updated sigc++config.h

Looks like the fix is already in git master, and all that is needed is a tarball release.
Comment 3 Murray Cumming 2010-05-04 19:19:55 UTC
Yes, this seems to be the fix:

2009-10-26  Armin Burgmeier  <armin@arbur.net>

	* sigc++config.h: Move the first five definitions to the !SIGC_MSC
	ifdef block, so MSVC does not see them and only uses the definitions
	from the SIGC_MSC block. This fixes the build with MSVC.

We've had two tarball releases since then, so I guess this is no problem now.