1 #ifndef DEFINES_H 2 #define DEFINES_H 3 4 /** $MirOS: src/usr.bin/make/defines.h,v 1.6 2006/08/26 21:29:00 tg Exp $ */ 5 /* $OpenBSD: defines.h,v 1.2 2002/02/19 19:39:38 millert Exp $ */ 6 7 /* 8 * Copyright (c) 2001 Marc Espie. 9 * 10 * Redistribution and use in source and binary forms, with or without 11 * modification, are permitted provided that the following conditions 12 * are met: 13 * 1. Redistributions of source code must retain the above copyright 14 * notice, this list of conditions and the following disclaimer. 15 * 2. Redistributions in binary form must reproduce the above copyright 16 * notice, this list of conditions and the following disclaimer in the 17 * documentation and/or other materials provided with the distribution. 18 * 19 * THIS SOFTWARE IS PROVIDED BY THE OPENBSD PROJECT AND CONTRIBUTORS 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBSD 23 * PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 */ 31 32 #include <stdbool.h> 33 34 /* define common types in an opaque way */ 35 struct GNode_; 36 typedef struct GNode_ GNode; 37 38 struct List_; 39 typedef struct List_ *Lst; 40 41 struct SymTable_; 42 typedef struct SymTable_ SymTable; 43 44 struct ohash; 45 typedef struct ohash GSymT; 46 47 struct Buffer_; 48 typedef struct Buffer_ *Buffer; 49 50 struct Name; 51 52 struct ListNode_; 53 typedef struct ListNode_ *LstNode; 54 55 /* some useful defines for gcc */ 56 57 #ifdef __GNUC__ 58 # define UNUSED __attribute__((__unused__)) 59 # define HAS_INLINES 60 # define INLINE __inline__ 61 #else 62 # define UNUSED 63 #endif 64 65 #ifdef HAS_INLINES 66 # ifndef INLINE 67 # define INLINE inline 68 # endif 69 #endif 70 71 /* 72 * debug control: 73 * There is one bit per module. It is up to the module what debug 74 * information to print. 75 */ 76 extern int debug; 77 #define DEBUG_ARCH 0x0001 78 #define DEBUG_COND 0x0002 79 #define DEBUG_DIR 0x0004 80 #define DEBUG_GRAPH1 0x0008 81 #define DEBUG_GRAPH2 0x0010 82 #define DEBUG_JOB 0x0020 83 #define DEBUG_MAKE 0x0040 84 #define DEBUG_SUFF 0x0080 85 #define DEBUG_TARG 0x0100 86 #define DEBUG_VAR 0x0200 87 #define DEBUG_FOR 0x0400 88 #define DEBUG_LOUD 0x0800 89 90 #define CONCAT(a,b) a##b 91 92 #define DEBUG(module) (debug & CONCAT(DEBUG_,module)) 93 94 #ifndef __RCSID 95 #define __RCSID(x) static const char __rcsid[] = x 96 #endif 97 98 #endif 99