1c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#ifndef _salt_debug_h 2c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#define _salt_debug_h 3c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 4c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering/* 5c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering * Copyright 2003, 2004 Porchdog Software. All rights reserved. 6c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering * 7c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering * Redistribution and use in source and binary forms, with or without modification, 8c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering * are permitted provided that the following conditions are met: 9c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering * 10c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering * 1. Redistributions of source code must retain the above copyright notice, 11a97605e07ad7f44f2f65e15be64880e61a39ab43Lennart Poettering * this list of conditions and the following disclaimer. 12c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering * 2. Redistributions in binary form must reproduce the above copyright notice, 13c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering * this list of conditions and the following disclaimer in the documentation 14c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering * and/or other materials provided with the distribution. 15c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering * 16c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering * THIS SOFTWARE IS PROVIDED BY PORCHDOG SOFTWARE ``AS IS'' AND ANY 17c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering * IN NO EVENT SHALL THE HOWL PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 20c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 21c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 23c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 24c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 25c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering * OF THE POSSIBILITY OF SUCH DAMAGE. 26c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering * 27c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering * The views and conclusions contained in the software and documentation are those 28c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering * of the authors and should not be interpreted as representing official policies, 29c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering * either expressed or implied, of Porchdog Software. 30c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering */ 31c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 32c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#include <salt/platform.h> 33c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#include <stdarg.h> 34c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 35c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 36c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#ifdef __cplusplus 37c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poetteringextern "C" 38c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering{ 39a97605e07ad7f44f2f65e15be64880e61a39ab43Lennart Poettering#endif 40c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 41c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 42c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#define SW_LOG_WARNING 1 << 0 43c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#define SW_LOG_ERROR 1 << 1 44c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#define SW_LOG_NOTICE 1 << 2 45c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#define SW_LOG_VERBOSE 1 << 3 46c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#define SW_LOG_OFF 0x0 47c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 48c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 49c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#if (defined( __GNUC__)) 50c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 51c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# if ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))) 52c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 53c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# define __C99_VA_ARGS__ 1 54c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 55c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# define __GNU_VA_ARGS__ 0 56c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 57c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# else 58c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 59c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# define __C99_VA_ARGS__ 0 60c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 61c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# define __GNU_VA_ARGS__ 1 62c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 63c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# endif 64c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 65c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#else 66c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 67c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# define __C99_VA_ARGS__ 0 68c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 69c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# define __GNU_VA_ARGS__ 0 70c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 71c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#endif 72c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 73c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 74c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# if ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 9))) 75c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 76c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# define __SW_FUNCTION__ __func__ 77c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 78c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#elif (defined( __GNUC__)) 79c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 80c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# define __SW_FUNCTION__ __PRETTY_FUNCTION__ 81c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 82c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#elif( defined(_MSC_VER ) && !defined(_WIN32_WCE)) 83c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 84c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# define __SW_FUNCTION__ __FUNCTION__ 85c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 86c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#else 87c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 88c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# define __SW_FUNCTION__ "" 89c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 90c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#endif 91c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 92c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 93c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#define sw_check(expr, label, action) \ 94c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poetteringdo \ 95c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering{ \ 96c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering if (!(expr)) \ 97c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering { \ 98c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering { \ 99c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering action; \ 100c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering } \ 101c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering goto label; \ 102c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering } \ 103c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering} while (0) 104c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 105c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 106c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#define sw_check_log(expr, label, action) \ 107c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poetteringdo \ 108c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering{ \ 109c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering if (!(expr)) \ 110c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering { \ 111c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering sw_print_assert(0, NULL, __FILE__, __SW_FUNCTION__, __LINE__); \ 112c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering { \ 113c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering action; \ 114c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering } \ 115c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering goto label; \ 116c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering } \ 117c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering} while (0) 118c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 119c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 120c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#define sw_check_okay(code, label) \ 121c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poetteringdo \ 122c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering{ \ 123c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering if ((int) code != 0) \ 124c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering { \ 125c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering goto label; \ 126c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering } \ 127c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering} while (0) 128c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 129c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 130c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#define sw_check_okay_log(code, label) \ 131c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poetteringdo \ 132c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering{ \ 133c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering if ((int) code != 0) \ 134c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering { \ 135c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering sw_print_assert((int) code, NULL, __FILE__, __SW_FUNCTION__, __LINE__); \ 136c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering goto label; \ 137c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering } \ 138c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering} while ( 0 ) 139c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 140c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 141c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#define sw_translate_error(expr, errno) ((expr) ? 0 : (errno)) 142c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 143c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 144c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#if defined(WIN32) 145c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 146c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# define sw_socket_errno() (int) WSAGetLastError() 147c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# define sw_set_socket_errno(X) WSASetLastError(X) 148c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# define sw_system_errno() (int) GetLastError() 149c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# define sw_set_system_errno(X) SetLastError(X) 150c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 151c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#else 152c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 153c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# define sw_socket_errno() errno 154c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# define sw_set_socket_errno(X) errno = X 155c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# define sw_system_errno() errno 156c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# define sw_set_system_errno(X) errno = X 157c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 158c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#endif 159c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 160c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 161c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#if !defined(NDEBUG) 162c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 163c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# define sw_assert(X) \ 164c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering \ 165c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering do \ 166c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering { \ 167c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering if (!(X)) \ 168c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering { \ 169c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering sw_print_assert( 0, #X, __FILE__, __SW_FUNCTION__, __LINE__); \ 170c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering } \ 171c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering } while( 0 ) 172c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 173c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#else 174c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 175c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# define sw_assert(X) 176c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 177c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#endif 178c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 179c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 180c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poetteringvoid HOWL_API 181c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poetteringsw_print_assert( 182c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering int code, 183c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering sw_const_string assert_string, 184c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering sw_const_string file, 185c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering sw_const_string func, 186c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering int line); 187c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 188c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 189c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#if !defined(NDEBUG) 190c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 191c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poetteringvoid HOWL_API 192c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poetteringsw_print_debug( 193c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering int level, 194c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering sw_const_string format, 195c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering ...); 196c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 197c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# if (__C99_VA_ARGS__) 198c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 199c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# define sw_debug(...) sw_print_debug(__VA_ARGS__) 200c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 201c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# else 202c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 203c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# define sw_debug sw_print_debug 204c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 205c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# endif 206c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 207c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#else 208c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 209c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# if (__C99_VA_ARGS__) 210c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 211c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# define sw_debug(...) 212c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 213c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# else 214c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 215c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# define sw_debug while( 0 ) 216c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 217c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering# endif 218c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 219c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#endif 220c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 221c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 222c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#define SW_UNUSED_PARAM(X) (void) (X) 223c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 224c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 225c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#if defined(__cplusplus) 226c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering} 227c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#endif 228c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 229c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering 230c6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40Lennart Poettering#endif 231