Commit 293d6b22 authored by Erik de Castro Lopo's avatar Erik de Castro Lopo
Browse files

macros.h: Make FLAC_CHECK_RETURN print to stderr

Also comment the fact that this macro should only be used for things
that are extremely unlikely to fail.
parent cc55e651
......@@ -32,10 +32,14 @@
#include <errno.h>
/* FLAC_CHECK_RETURN : Check the return value of the provided function and
* print and error message if it fails (ie returns a value < 0).
* print an error message if it fails (ie returns a value < 0).
*
* Ideally, a library should not print anything, but this macro is only used
* for things that extremely unlikely to fail, like `chown` to a previoulsy
* saved `uid`.
*/
#define FLAC_CHECK_RETURN(x) \
{ if ((x) < 0) \
printf ("%s : %s\n", #x, strerror (errno)) ; \
fprintf (stderr, "%s : %s\n", #x, strerror (errno)) ; \
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment