Opened 12 years ago

Closed 8 years ago

#4881 closed Patches (fixed)

TI compiler: compiling with integer.hpp fails

Reported by: Krzysztof Czainski <1czajnik@…> Owned by: viboes
Milestone: Boost 1.58.0 Component: integer
Version: Boost 1.45.0 Severity: Problem
Keywords: Cc:

Description

Hello,

1.45.0 is the seventh version of boost, which I am successfully using with a Texas Instruments compiler (actually, only some header-only parts of boost).

However, for every new version of boost i must make this change in boost:

Index: integer.hpp
===================================================================
--- integer.hpp	(revision 41)
+++ integer.hpp	(working copy)
@@ -89,7 +89,8 @@
   template <> struct exact_signed_base_helper<sizeof(int)* CHAR_BIT> { typedef int exact; };
   template <> struct exact_unsigned_base_helper<sizeof(unsigned int)* CHAR_BIT> { typedef unsigned int exact; };
 #endif
-#if ULONG_MAX != UINT_MAX
+#if ULONG_MAX != UINT_MAX && ( !defined __TI_COMPILER_VERSION__ || \
+		( __TI_COMPILER_VERSION__ >= 7000000 && !defined __TI_40BIT_LONG__ ) )
   template <> struct exact_signed_base_helper<sizeof(long)* CHAR_BIT> { typedef long exact; };
   template <> struct exact_unsigned_base_helper<sizeof(unsigned long)* CHAR_BIT> { typedef unsigned long exact; };
 #endif

The change is needed in order to avoid compilation errors about redefined exact_[un]signed_base_helper.

The condition

( !defined __TI_COMPILER_VERSION__ || \
		( __TI_COMPILER_VERSION__ >= 7000000 && !defined __TI_40BIT_LONG__ ) )

excludes cases, where sizeof(long)==8, but long the compiler treats it as a 40-bit integer.

So I thought maybe this could be resolved once and for all ;-)

Cheers Kris

Change History (4)

comment:1 by Vicente Botet <vicente.botet@…>, 12 years ago

Type: BugsPatches

comment:2 by viboes, 8 years ago

Owner: changed from Daryle Walker to viboes
Status: newassigned

comment:4 by viboes, 8 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.