Re: [cc65] Common macros for dirent.d_type

From: Oliver Schmidt <ol.sc1web.de>
Date: 2012-06-25 18:04:24
Hi Groepaz,

> > I see. From my perspective this means that there's nothing to do at all:
> > Code caring about cross-target needs to check for the existence of _D_ISxxx
> > macros anyway because if they don't exsist then the d_type field might not
> > exist at all. At least that's how I see it...

> i personally hate this way of library design. instead of defining some macros
> (that eventually do nothing, or return 0) for every target, you then end up
> with ifdef hell in every program. this is a perfect example for that kind of
> thing infact, defining the macros doesnt hurt anyone and has zero drawbacks.

Maybe I get you wrong but the macros in question are taking the d_type
field as parameter. So if there's no d_type at all you'd get a
compiler error. Therefore "my" idea of checking for existence of the
macros. Alternative I could imagine:
- Making the d_type field mandatory
- Moving the "->d_type" into the macros (for targets with d_type)

Regards,
Oliver
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Jun 25 18:04:37 2012

This archive was generated by hypermail 2.1.8 : 2012-06-25 18:04:41 CEST