This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Re: new __builtin_choose_type (patch)


On Tue, 2001-10-02 at 15:57, Phil Edwards wrote:
> On Tue, Oct 02, 2001 at 12:29:35PM -0700, Dale Johannesen wrote:
> > OTOH, overloading is in C99 already for the math lib
> > functions, isn't it?

nope.  tgmath.h, compliments of geoff:

    /* This is ugly but unless gcc gets appropriate builtins we have to do
       something like this.  Don't ask how it works.  */
    
    /* 1 if 'type' is a floating type, 0 if 'type' is an integer type.
       Allows for _Bool.  Expands to an integer constant expression.  */
    # define __floating_type(type) (((type) 0.25) && ((type) 0.25 - 1))
    
    /* The tgmath real type for T, where E is 0 if T is an integer type and
       1 for a floating type.  */
    # define __tgmath_real_type_sub(T, E) \
      __typeof__(*(0 ? (__typeof__ (0 ? (double *) 0 : (void *) (E))) 0           \
                     : (__typeof__ (0 ? (T *) 0 : (void *) (!(E)))) 0))
    
with my proposed builtin_choose_type we could simplify this a lot.
    
> 
> I don't believe so.
> 
> 
> Phil
> 
> -- 
> If ye love wealth greater than liberty, the tranquility of servitude greater
> than the animating contest for freedom, go home and leave us in peace.  We seek
> not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
> and may posterity forget that ye were our countrymen.            - Samuel Adams
-- 
Aldy Hernandez					E-mail: aldyh@redhat.com
Professional Gypsy on a Motorcycle
Red Hat, Inc.


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