[libc] Use __einfo() tuple as first argument to EUNIQ()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2013-04-18 01:05:32 +01:00
parent 0f7b3fa6f9
commit e42bc3aa37
6 changed files with 86 additions and 83 deletions

View File

@@ -187,8 +187,8 @@ extern char missing_errfile_declaration[] __attribute__ (( deprecated ));
/**
* Disambiguate a base error based on non-constant information
*
* @v error_base Base error
* @v uniq Error disambiguator
* @v einfo_base Base error information
* @v uniq Error disambiguator (0x00-0x1f)
* @v ... List of expected possible disambiguated errors
* @ret error Error
*
@@ -200,9 +200,10 @@ extern char missing_errfile_declaration[] __attribute__ (( deprecated ));
* EUNIQ() should not be used for constant error disambiguators; use
* __einfo_uniqify() instead.
*/
#define EUNIQ( errno, uniq, ... ) ( { \
euniq_discard ( 0, ##__VA_ARGS__); \
( ( int ) ( (errno) | ( (uniq) << 8 ) ) ); } )
#define EUNIQ( einfo_base, uniq, ... ) ( { \
euniq_discard ( 0, ##__VA_ARGS__ ); \
( ( int ) ( __einfo_error ( einfo_base ) | \
( (uniq) << 8 ) ) ); } )
static inline void euniq_discard ( int dummy __unused, ... ) {}
/**