Re: [AD] for_each_entry API function

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 20 January 2003 17:24, Eric Botcazou wrote:
> This patch implements the new for_each_entry() API function,
> deprecates the former for_each_file() and converts tests/filetest.c
> to use the new function. Tested on Linux.

As an aside, have you seen the `deprecated' attribute in GCC? I've only
just noticed it (I have gcc 3.2.1), and I'm sure it wasn't in 2.9.5.3,
so if we used it we'd have to test for it. Basically, after the
declaration (not definition) of a type, variable or function, you add
__attribute__((deprecated)), and gcc warns you that said symbol is
going to be removed whenever it encounters an actual use.

So we'd probably do something like this (assuming availability in any
gcc version 3):

#if __GNUC__ > 2
#define DEPRECATED() __attribute__((deprecated))
#else
#define DEPRECATED()
#endif

/* the old (and broken!) file enumeration function */
AL_FUNC(int, for_each_file, (AL_CONST char *name, int attrib,
AL_METHOD(void, callback, (AL_CONST char *filename, int attrib, int
param)), int param)) DEPRECATED();

Bye for now,
- --
Laurence Withers,  lwithers@xxxxxxxxxx
(GnuPG 04A646EA) http://www.lwithers.demon.co.uk/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+LxTxUdhclgSmRuoRAsAYAJ4t7lzorBH6XmrCJIF5MQKLThYoKgCgkapf
EKFIJU7+CgGAv6NEZm1glBU=
=a3R2
-----END PGP SIGNATURE-----





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/