Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

xdvshow-defs.h

Go to the documentation of this file.
00001 /* We need thread-safe sem_wait that works on FreeBSD as well as on Linux */ 00002 /* This is to avoid problem with FreeBSD/KSE (5.2.1) getting stuck in sem_wait 00003 * call; sem_wait doesn't seem to be pthread_testcancel() point there :-(( */ 00004 #ifndef FREEBSD_5 00005 #define ts_sem_wait(semaphore) \ 00006 if(sem_wait(semaphore) != 0) { \ 00007 perror("sem_wait"); \ 00008 assert(0); \ 00009 } 00010 #else 00011 #define ts_sem_wait(semaphore) \ 00012 while(sem_trywait(semaphore) != 0) { \ 00013 if(errno != EAGAIN) { \ 00014 perror("sem_trywait"); \ 00015 assert(0); \ 00016 } \ 00017 usleep(1); \ 00018 } 00019 #endif /* FREEBSD_5 */ 00020 00021 /* I wonder why the heck the damned libdv/dv_types.h header does the following: 00022 #define __FUNCTION__ __FILE__ // Less specific info, but it's a string. 00023 */ 00024 #undef __FUNCTION__ 00025 #ifdef DEBUG 00026 #define DPRINT(fmt, args...) \ 00027 fprintf(stderr, "(%s:%d) %s(): " fmt, __FILE__, __LINE__ , __FUNCTION__ , ##args); fflush(stderr); 00028 #define DPRINT_BARE(fmt, args...) \ 00029 fprintf(stderr, fmt, ##args); fflush(stderr); 00030 #else 00031 #define DPRINT(fmt, args...) ((void)0) 00032 #define DPRINT_BARE(fmt, args...) ((void)0) 00033 #endif /* DEBUG */

Generated on Wed Nov 3 19:19:02 2004 for xdvshow by doxygen 1.3.7