Changeset 93
- Timestamp:
- May 4, 2007, 8:15:36 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/alsa-resync1/alsa-kernel/include/sound/driver.h
r92 r93 23 23 */ 24 24 25 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)26 #define NEW_MACRO_VARARGS27 #endif28 29 25 #ifdef ALSA_BUILD 30 26 #include "config.h" … … 106 102 #include <linux/kernel.h> 107 103 #include <linux/sched.h> 108 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 7)109 #include <linux/malloc.h>110 #else111 104 #include <linux/slab.h> 112 #endif113 105 #include <linux/delay.h> 114 106 #include <linux/bitops.h> … … 597 589 /* --- */ 598 590 599 #ifdef NEW_MACRO_VARARGS 600 601 /* 602 * VARARGS section 603 */ 604 605 #define snd_printk(...) do {\ 591 #define snd_printk(format, args...) do { \ 606 592 printk("ALSA %s:%d: ", __FILE__, __LINE__); \ 607 printk(__VA_ARGS__); \593 printk(format, ##args); \ 608 594 } while (0) 609 595 610 596 #ifdef CONFIG_SND_DEBUG 611 597 612 #define snd_printd( ...) snd_printk(__VA_ARGS__)613 #define snd_assert(expr, ...) do {\598 #define snd_printd(format, args...) snd_printk(format, ##args) 599 #define snd_assert(expr, args...) do {\ 614 600 if (!(expr)) {\ 615 601 snd_printk("BUG? (%s) (called from %p)\n", __STRING(expr), __builtin_return_address(0));\ 616 __VA_ARGS__;\ 617 }\ 618 } while (0) 619 #define snd_runtime_check(expr, ...) do {\ 620 if (!(expr)) {\ 621 snd_printk("ERROR (%s) (called from %p)\n", __STRING(expr), __builtin_return_address(0));\ 622 __VA_ARGS__;\ 623 }\ 624 } while (0) 625 626 #else /* !CONFIG_SND_DEBUG */ 627 628 #define snd_printd(...) /* nothing */ 629 #define snd_assert(expr, ...) /* nothing */ 630 #define snd_runtime_check(expr, ...) do { if (!(expr)) {__VA_ARGS__;} } while (0) 631 632 #endif /* CONFIG_SND_DEBUG */ 633 634 #ifdef CONFIG_SND_DEBUG_DETECT 635 #define snd_printdd(...) snd_printk(__VA_ARGS__) 636 #else 637 #define snd_printdd(...) /* nothing */ 638 #endif 639 640 #else /* !NEW_MACRO_VARARGS */ 641 642 /* 643 * Old args section... 644 */ 645 646 #ifdef TARGET_OS2 647 648 #define snd_printk printk 649 650 #ifdef CONFIG_SND_DEBUG 651 652 #define snd_printd snd_printk 653 #define snd_assert(expr, retval) \ 654 if (!(expr)) {\ 655 snd_printk("BUG? (%s)\n", __STRING(expr));\ 656 ##retval;\ 657 } 658 659 #define snd_runtime_check snd_assert 660 #define snd_runtime_check_continue snd_assert_continue 661 662 663 #else /* !CONFIG_SND_DEBUG */ 664 665 #define snd_printd 1 ? (void)0 : (void)((int (*)(char *, ...)) NULL) 666 #define snd_assert(expr, retval) \ 667 if (!(expr)) {\ 668 ##retval;\ 669 } 670 #define snd_runtime_check snd_assert 671 672 #endif /* CONFIG_SND_DEBUG */ 673 674 #ifdef CONFIG_SND_DEBUG_DETECT 675 #define snd_printdd snd_printk 676 #else 677 #define snd_printdd 1 ? (void)0 : (void)((int (*)(char *, ...)) NULL) 678 #endif 679 680 #else 681 #define snd_printk(args...) do {\ 682 printk("ALSA %s:%d: ", __FILE__, __LINE__); \ 683 printk(##args); \ 684 } while (0) 685 686 #ifdef CONFIG_SND_DEBUG 687 688 #define snd_printd(args...) snd_printk(##args) 689 #define snd_assert(expr, args...) do {\ 690 if (!(expr)) {\ 691 snd_printk("BUG? (%s)\n", __STRING(expr));\ 692 ##args;\ 602 args;\ 693 603 }\ 694 604 } while (0) 695 605 #define snd_runtime_check(expr, args...) do {\ 696 606 if (!(expr)) {\ 697 snd_printk("ERROR (%s) \n", __STRING(expr));\698 ##args;\607 snd_printk("ERROR (%s) (called from %p)\n", __STRING(expr), __builtin_return_address(0));\ 608 args;\ 699 609 }\ 700 610 } while (0) … … 702 612 #else /* !CONFIG_SND_DEBUG */ 703 613 704 #define snd_printd( args...)/* nothing */614 #define snd_printd(format, args...) /* nothing */ 705 615 #define snd_assert(expr, args...) /* nothing */ 706 #define snd_runtime_check(expr, args...) do { if (!(expr)) { ##args;} } while (0)616 #define snd_runtime_check(expr, args...) do { if (!(expr)) { args; } } while (0) 707 617 708 618 #endif /* CONFIG_SND_DEBUG */ 709 619 710 620 #ifdef CONFIG_SND_DEBUG_DETECT 711 #define snd_printdd( args...) snd_printk(##args)621 #define snd_printdd(format, args...) snd_printk(format, ##args) 712 622 #else 713 #define snd_printdd( args...) /* nothing */714 #endif 715 #endif 716 717 #endif /* NEW_MACRO_VARARGS */ 623 #define snd_printdd(format, args...) /* nothing */ 624 #endif 625 626 #define snd_BUG() snd_assert(0, ) 627 718 628 719 629 #ifdef DEBUG
Note:
See TracChangeset
for help on using the changeset viewer.