lkml.org 
[lkml]   [2004]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC/patch] macro_removal_agp_mtrr.diff
On Sat, Sep 04, 2004 at 11:30:40AM +0100, Dave Airlie wrote:
> so something like
> static inline int drm_core_has_AGP(struct drm_device *dev)
> {
> #if __OS_HAS_AGP
> return drm_core_check_feature(dev, DRIVER_USE_AGP);
> #else
> return 0;
> }
>
> or the macro one
>
> #if __OS_HAS_AGP
> #define drm_core_has_AGP(dev) drm_core_check_feature(dev, DRIVER_USE_AGP)
> #else
> #define drm_core_has_AGP(dev) (0)
> #endif
>
> if the inline will work I'll be happier using it.. I just need to know it
> works for the range of compilers we use...

please do not put ifdefs inside functions;
how about

#if __OS_HAS_AGP
static inline int drm_core_has_AGP(struct drm_device *dev)
{
return drm_core_check_feature(dev, DRIVER_USE_AGP);
}
#else
#define drm_core_has_AGP(dev) 0
#endif


where you can make the later an inline if you really want to but I don't see
the point.

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 14:05    [W:0.060 / U:0.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site