Changeset 1360
- Timestamp:
- Nov 12, 2006, 2:11:01 PM (14 years ago)
- Location:
- libcaca/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/common.h
r1304 r1360 31 31 typedef long int intptr_t; 32 32 typedef unsigned long int uintptr_t; 33 #endif 34 35 #if defined DEBUG && !defined __KERNEL__ 36 # include <stdio.h> 37 # include <stdarg.h> 38 # if defined(HAVE_ERRNO_H) 39 # include <errno.h> 40 # endif 41 static inline void debug(const char *format, ...) 42 { 43 # if defined(HAVE_ERRNO_H) 44 int saved_errno = errno; 45 # endif 46 va_list args; 47 va_start(args, format); 48 fprintf(stderr, "** libcaca debug ** "); 49 vfprintf(stderr, format, args); 50 fprintf(stderr, "\n"); 51 va_end(args); 52 # if defined(HAVE_ERRNO_H) 53 errno = saved_errno; 54 # endif 55 } 56 #else 57 # define debug(format, ...) do {} while(0) 33 58 #endif 34 59 -
libcaca/trunk/configure.ac
r1285 r1360 63 63 64 64 dnl conditional builds 65 AC_ARG_ENABLE(debug, 66 [ --enable-debug build debug versions of the library]) 65 67 AC_ARG_ENABLE(plugins, 66 68 [ --enable-plugins build X11 and GL drivers as plugins]) … … 227 229 AM_CONDITIONAL(USE_KERNEL, test "${ac_cv_my_have_vga}" = "yes") 228 230 231 if test "${enable_debug}" = "yes"; then 232 AC_DEFINE(DEBUG, 1, Define to 1 to activate debug) 233 fi 234 229 235 if test "${enable_plugins}" = "yes"; then 230 236 ac_cv_my_have_plugins="yes" -
libcaca/trunk/cucul/export.c
r1357 r1360 277 277 278 278 /* Crop to really used size */ 279 debug("utf8 export: alloc %li bytes, realloc %li\n", 280 (long int)*bytes, (long int)(uintptr_t)(cur - data)); 279 281 *bytes = (uintptr_t)(cur - data); 280 282 data = realloc(data, *bytes); … … 355 357 356 358 /* Crop to really used size */ 359 debug("ansi export: alloc %li bytes, realloc %li\n", 360 (long int)*bytes, (long int)(uintptr_t)(cur - data)); 357 361 *bytes = (uintptr_t)(cur - data); 358 362 data = realloc(data, *bytes); … … 429 433 430 434 /* Crop to really used size */ 435 debug("html export: alloc %li bytes, realloc %li\n", 436 (long int)*bytes, (long int)(uintptr_t)(cur - data)); 431 437 *bytes = (uintptr_t)(cur - data); 432 438 data = realloc(data, *bytes); … … 522 528 523 529 /* Crop to really used size */ 530 debug("html3 export: alloc %li bytes, realloc %li\n", 531 (long int)*bytes, (long int)(uintptr_t)(cur - data)); 524 532 *bytes = (uintptr_t)(cur - data); 525 533 data = realloc(data, *bytes); … … 627 635 628 636 /* Crop to really used size */ 637 debug("IRC export: alloc %li bytes, realloc %li\n", 638 (long int)*bytes, (long int)(uintptr_t)(cur - data)); 629 639 *bytes = (uintptr_t)(cur - data); 630 640 data = realloc(data, *bytes); … … 734 744 735 745 /* Crop to really used size */ 746 debug("PS export: alloc %li bytes, realloc %li\n", 747 (long int)*bytes, (long int)(uintptr_t)(cur - data)); 736 748 *bytes = (uintptr_t)(cur - data); 737 749 data = realloc(data, *bytes); … … 818 830 819 831 /* Crop to really used size */ 832 debug("SVG export: alloc %li bytes, realloc %li\n", 833 (long int)*bytes, (long int)(uintptr_t)(cur - data)); 820 834 *bytes = (uintptr_t)(cur - data); 821 835 data = realloc(data, *bytes);
Note: See TracChangeset
for help on using the changeset viewer.