1 /******************************************************************** 2 * swlogic.h - switch logic, loaded from various versions of switch.h 3 * 4 * Copyright 1989 Carnegie Mellon University 5 * 6 *********************************************************************/ 7 8 /* 9 * When included, one of the following should be defined: 10 * AZTEC (manx compiler, implies AMIGA) 11 * THINK_C (Think C compiler, implies Macintosh) 12 * __MWERKS__ (Metrowerks C compiler, implies Macintosh) 13 * LATTICE & DOS (Lattice compiler for IBM PC/AT/XT/CLONES) 14 * MICROSOFT & DOS (Microsoft compiler, implies IBM PC/AT/XT/CLONES) 15 * UNIX (emulator for UNIX) 16 * UNIX_ITC (ITC code for RS6000) 17 * UNIX_MACH (MACH ukernel system) 18 */ 19 20 /*------------------------------------------*/ 21 /* Other switches that might be defined in switches.h are as follows: */ 22 /* APPLICATION, SPACE_FOR_PLAY, MAX_CHANNELS */ 23 /*------------------------------------------*/ 24 25 /* We're moving toward the elimination of switches.h, so try to map 26 * predefined constants into our standard constants shown above: 27 */ 28 29 /* CHANGE LOG 30 * -------------------------------------------------------------------- 31 * 28Apr03 dm new conditional compilation structure 32 * 28Apr03 rbd remove macro redefinitions: MICROSOFT 33 */ 34 35 36 37 /* Microsoft C compiler: */ 38 #ifdef _MSC_VER 39 #endif 40 #ifdef _MSDOS 41 #define DOS 42 #endif 43 44 /* Quick C compiler: */ 45 #ifndef DOS 46 #ifdef MICROSOFT 47 #define DOS 48 #endif 49 #endif 50 51 /* Borland C compiler: */ 52 #ifdef __BORLANDC__ 53 #define BORLAND 54 #define DOS 55 #endif 56 57 /* Borland Turbo C compiler: */ 58 #ifdef __TURBOC__ 59 #define BORLAND] 60 #define DOS 61 #endif 62 63 /* SGI systems */ 64 #ifdef sgi 65 #ifndef UNIX 66 #define UNIX 67 #endif 68 #define UNIX_IRIX 69 #define MAX_CHANNELS 32 70 #endif 71 72 /* APPLICATION -- define APPLICATION if you want to disable 73 * looking for command line switches in the midi interface. 74 * I think this feature is here for the Piano Tutor project 75 * and you should not define APPLICATION for CMU Midi Toolkit 76 * projects (APPLICATION is a poor choice of terms): 77 */ 78 79 80 /* memory space management (system dependent): 81 * SPACE_FOR_PLAY must be enough space to allow 82 * seq to play a score. This may include space for 83 * note-off events, I/O buffers, etc. 84 */ 85 #ifndef SPACE_FOR_PLAY 86 #define SPACE_FOR_PLAY 10000L 87 #endif 88 89 90 /* How many MIDI channels are there? MACINTOSH can use 2 ports, 91 * so it supports 32 channels. Others have one port, 16 channels. 92 * On the other hand, if you don't have all the MIDI ports plugged 93 * into MIDI interfaces, CMT will just hang, so I'll compile with 94 * just 16 channels. The 32 channel option for the Mac is untested. 95 */ 96 #ifndef MAX_CHANNELS 97 #define MAX_CHANNELS 16 98 #endif 99 100 101 /*------------------------------------------*/ 102 /* Now we get to the "logic": define things as a function of what 103 * was defined in switches.h 104 */ 105 106 #ifdef THINK_C 107 #define MACINTOSH 108 #endif 109 110 #ifdef __MWERKS__ 111 #define MACINTOSH 112 #endif 113 114 #ifdef MACINTOSH 115 #define MACINTOSH_OR_DOS 116 #define MACINTOSH_OR_UNIX 117 /* I don't know if THINK_C defines this and we need it for a few prototypes... */ 118 #ifndef __STDC__ 119 #define __STDC__ 120 #endif 121 #ifndef TAB_WIDTH 122 #define TAB_WIDTH 4 123 #endif 124 #endif 125 126 #ifndef TAB_WIDTH 127 #define TAB_WIDTH 8 128 #endif 129 130 /* 131 * If MIDIMGR is defined, compile for the Apple MIDI Manager 132 * (Non MIDI manager code is no longer supported) 133 */ 134 #ifdef MACINTOSH 135 /* under Nyquist, the MidiMgr is not used, so you can't 136 * receive or send Midi as in CMU MIDI Toolkit; however, 137 * much of CMU MIDI Toolkit is used for Midi file IO 138 */ 139 #ifndef NYQUIST 140 #define MIDIMGR 141 #endif 142 #define HAVE_VSNPRINTF 1 143 #endif 144 145 #ifdef BORLAND 146 #define DOS 147 #endif 148 149 #ifdef LATTICE322 150 #define DOS 151 #define OLD_PROTOTYPES 152 #endif 153 154 #ifdef UNIX_ITC 155 #define UNIX 156 #define ITC 157 #endif 158 159 #ifdef UNIX_MACH 160 #define UNIX 161 #define ITC 162 #endif 163 164 /* HAVE_VSNPRINTF says vsnprintf() is defined */ 165 #ifdef ITC 166 #define HAVE_VSNPRINTF 1 167 #endif 168 #ifdef AZTEC 169 #define HAVE_VSNPRINTF 1 170 #endif 171 172 173 /* DOTS_FOR_ARGS says ANSI "..." notation is recognized */ 174 #ifdef __STDC__ 175 #define DOTS_FOR_ARGS 176 #endif 177 #ifdef UNIX_ITC 178 #define DOTS_FOR_ARGS 179 #endif 180 #ifdef BORLAND 181 #define DOTS_FOR_ARGS 182 #endif 183 #ifdef MICROSOFT 184 #define DOTS_FOR_ARGS 185 #endif 186 187 #ifdef DOS 188 #define MACINTOSH_OR_DOS 189 #else 190 #define huge 191 #endif 192 193 #ifdef UNIX 194 #define MACINTOSH_OR_UNIX 195 #endif 196 197 #define SWITCHES 198