Messages in this thread | | | Date | Sat, 4 Sep 2004 12:36:48 +0200 | From | Arjan van de Ven <> | Subject | Re: [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] | |