This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Test for host long long support rather than for gcc


Hi Ian,

> The potential drawback is that bfd.h is installed, and it is
> possible that somebody will use it with a different compiler.
> Therefore, using tests for the host compiler in bfd.h is not
> necessarily completely safe.  However, it should be fine in
> practice.

I do not think that this will be a serious problem.  One possible way
to work around the problem though would be to conditionalize the
definitions of BFD_HOST_64BIT_LONG and BFD_HOST_LONG_LONG, so that
they could be overridden on the command line, if necessary.  ie
something like this:

Index: bfd/bfd-in.h
===================================================================
RCS file: /cvs/src/src/bfd/bfd-in.h,v
retrieving revision 1.65
diff -c -3 -p -r1.65 bfd-in.h
*** bfd/bfd-in.h	27 Aug 2003 17:43:38 -0000	1.65
--- bfd/bfd-in.h	2 Sep 2003 14:25:06 -0000
*************** extern "C" {
*** 50,57 ****
--- 50,69 ----
  /* The word size of the default bfd target.  */
  #define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@
  
+ /* Set to one if the host compiler's long type contains at least 64 bits.
+    This is determined at configure time, but can be overridden on the
+    command line by using -DBFD_HOST_64BIT_LONG=[0|1].  */
+ #ifndef BFD_HOST_64BIT_LONG
  #define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@
+ #endif
+ 
+ /* Set to one if the host compiler supports the "long long" type.
+    This is determined at configure time, but can be overridden on
+    the command line by using -DBFD_HOST_LONG_LONG=[0|1].  */
+ #ifndef BFD_HOST_LONG_LONG
  #define BFD_HOST_LONG_LONG @BFD_HOST_LONG_LONG@
+ #endif
+ 
  #if @BFD_HOST_64_BIT_DEFINED@
  #define BFD_HOST_64_BIT @BFD_HOST_64_BIT@
  #define BFD_HOST_U_64_BIT @BFD_HOST_U_64_BIT@

Cheers
        Nick
        



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]