Opened 14 years ago

Closed 14 years ago

#2569 closed Patches (fixed)

export macro cannot be used on same line # in different files in same translation unit

Reported by: kfriddile@… Owned by: Robert Ramey
Milestone: Boost 1.38.0 Component: serialization
Version: Boost 1.37.0 Severity: Problem
Keywords: Cc:

Description

In export.hpp the BOOST_CLASS_EXPORT macro calls the BOOST_CLASS_EXPORT_GUID macro which uses the LINE directive in an attempt to create a globally unique variable name. However, if multiple headers use the aforementioned macro on the same line #, and are included in the same translation unit, compilation will fail due to variable redefinition. This scenario isn't unlikely, as I had three conflicting headers out of the five I included in a single cpp. I have attached a patch in unified diff format that fixes this issue for me, but has not been run through any unit tests.

Attachments (1)

boost_serialization.patch (2.1 KB ) - added by kfriddile@… 14 years ago.

Download all attachments as: .zip

Change History (2)

by kfriddile@…, 14 years ago

Attachment: boost_serialization.patch added

comment:1 by Robert Ramey, 14 years ago

Resolution: fixed
Status: newclosed

This looks ok. I rolled in a version of this patch to my local system where it will eventually migrate into the package.

Robert Ramey

Note: See TracTickets for help on using tickets.