ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
Re: [boost] Mac OS 10 & type_traits/type_with_alignment.hpp
by Ralf W. Grosse-Kunstleve other posts by this author
Nov 5 2003 7:48PM messages near this date
Re: [boost] Mac OS 10 & type_traits/type_with_alignment.hpp | [boost] Re: Mac OS 10 & type_traits/type_with_alignment.hpp
Hi Doug,

Mike Owen reports the same problem while compiling Boost.Python extensions
under AIX with g++ 3.2.1 and 3.2.3. type_with_alignment.hpp does not cope with
a type that is 8-byte aligned.

We have established that the little test below runs under AIX without crashing.
> From that we conclude that AIX does not have strict alignment requirements,
just like the PowerPC Macintosh. Would it seem reasonable to check in the
trivial patch below?

Thanks,
        Ralf

--- Douglas Gregor <gregod@[...].edu>  wrote:
>  ----- Original Message -----
>  From: "Ralf W. Grosse-Kunstleve" <rwgk@[...].com>
>  To: "Boost mailing list" <boost@[...].org>
>  Sent: Saturday, June 07, 2003 5:50 AM
>  Subject: Re: [boost] Mac OS 10 & type_traits/type_with_alignment.hpp
>  
>  
>  > --- Douglas Gregor <gregod@[...].edu> wrote:
>  > /var/tmp/mac/boost/boost/type_traits/type_with_alignment.hpp:120:
>  > error: no type named `type' in `boost::maybe_print_align<false, 8, 4>'
>  
>  So you have a type that is 8-byte aligned, but we don't have any types in
>  the list of possible types that have an alignment of 8 on that architecture,
>  so it fails. We'll just have to find a type that has 8-byte alignment and
>  add it to the list. I'll see if I can dig one up tomorrow.
>  
>      Doug


#include <iostream> 

int main(void)
{
  char buf[2*sizeof(double)];
  for(int i=0;i<sizeof(double);i++) {
    double* d = (double*) &buf[i];
    *d = 120.+i;
    std::cout << *d << std::endl;
  }
}


Index: boost/type_traits/type_with_alignment.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/type_traits/type_with_alignment.hpp,v
retrieving revision 1.14
diff -u -r1.14 type_with_alignment.hpp
--- boost/type_traits/type_with_alignment.hpp	3 Sep 2003 15:19:12 -0000	1.14
+++ boost/type_traits/type_with_alignment.hpp	4 Nov 2003 00:31:00 -0000
@@ -132,7 +132,7 @@
 
     BOOST_STATIC_CONSTANT(std::size_t, found = alignment_of<align_t> ::value);
 
-#if !(defined(__APPLE__) && defined(__MACH__) && defined(__GNUC__))
+#if !(((defined(__APPLE__) && defined(__MACH__)) || defined(_AIX)) && 
defined(__GNUC__))
     BOOST_STATIC_ASSERT(found > = Align);
     BOOST_STATIC_ASSERT(found % Align == 0);
 #endif


__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Ralf W. Grosse-Kunstleve
Douglas Gregor
Ralf W. Grosse-Kunstleve
Douglas Gregor
Ralf W. Grosse-Kunstleve
David Abrahams
Douglas Paul Gregor
Douglas Paul Gregor
Ralf W. Grosse-Kunstleve

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved