[421b7d2] | 1 | /* osdepend.h |
---|
[d1b1380] | 2 | * Contains commonly required OS dependent bits |
---|
[affaeee] | 3 | * Copyright (C) 1993-2003,2004,2005 Olly Betts |
---|
[846746e] | 4 | * |
---|
[89231c4] | 5 | * This program is free software; you can redistribute it and/or modify |
---|
| 6 | * it under the terms of the GNU General Public License as published by |
---|
| 7 | * the Free Software Foundation; either version 2 of the License, or |
---|
| 8 | * (at your option) any later version. |
---|
[846746e] | 9 | * |
---|
| 10 | * This program is distributed in the hope that it will be useful, |
---|
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
[89231c4] | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 13 | * GNU General Public License for more details. |
---|
[846746e] | 14 | * |
---|
[89231c4] | 15 | * You should have received a copy of the GNU General Public License |
---|
| 16 | * along with this program; if not, write to the Free Software |
---|
[ecbc6c18] | 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
[d1b1380] | 18 | */ |
---|
| 19 | |
---|
| 20 | /* Note to porters: defaults are at the end of the file. Check there first */ |
---|
| 21 | |
---|
| 22 | #ifndef OSDEPEND_H /* only include once */ |
---|
| 23 | # define OSDEPEND_H |
---|
| 24 | |
---|
| 25 | # include "whichos.h" |
---|
| 26 | # include "ostypes.h" |
---|
| 27 | |
---|
[affaeee] | 28 | # if OS_WIN32 |
---|
[d1b1380] | 29 | |
---|
| 30 | /* FNM_SEP_DRV and FNM_SEP_EXT and FNM_SEP_LEV2 needn't be defined */ |
---|
| 31 | # define FNM_SEP_LEV '\\' |
---|
| 32 | # define FNM_SEP_LEV2 '/' |
---|
| 33 | # define FNM_SEP_DRV ':' |
---|
| 34 | # define FNM_SEP_EXT '.' |
---|
| 35 | |
---|
[1ec8db0] | 36 | # ifdef __TURBOC__ |
---|
| 37 | # include <time.h> |
---|
| 38 | # ifndef CLOCKS_PER_SEC |
---|
| 39 | # define CLOCKS_PER_SEC CLK_TCK |
---|
| 40 | # endif |
---|
| 41 | # endif |
---|
| 42 | |
---|
[affaeee] | 43 | # elif OS_UNIX |
---|
[d1b1380] | 44 | |
---|
| 45 | /* FNM_SEP_DRV and FNM_SEP_EXT needn't be defined */ |
---|
| 46 | # define FNM_SEP_LEV '/' |
---|
| 47 | /* # define FNM_SEP_DRV No equivalent under UNIX */ |
---|
| 48 | # define FNM_SEP_EXT '.' |
---|
| 49 | |
---|
| 50 | # define NO_STDPRN |
---|
| 51 | |
---|
[affaeee] | 52 | # else |
---|
| 53 | # error Do not know what to do for this operating system |
---|
| 54 | # endif |
---|
[d1b1380] | 55 | |
---|
| 56 | /***************************************************************************/ |
---|
| 57 | |
---|
[64d37a3] | 58 | /* Use "Far" rather than "FAR" to avoid colliding with windows headers |
---|
| 59 | * which may "#define FAR far" and "#define far" or something similar. |
---|
| 60 | * |
---|
| 61 | * Use "Huge" to avoid colliding with "HUGE" which is a pre-ANSI name for |
---|
| 62 | * "HUGE_VAL" |
---|
| 63 | */ |
---|
[b01aed9] | 64 | # ifdef HAVE_FAR_POINTERS |
---|
[64d37a3] | 65 | # define Far far |
---|
[b01aed9] | 66 | # define Huge huge |
---|
| 67 | # else |
---|
| 68 | /* just lose these on a sensible OS */ |
---|
[64d37a3] | 69 | # define Far |
---|
[b01aed9] | 70 | # define Huge |
---|
[d1b1380] | 71 | # endif /* !Huge */ |
---|
| 72 | |
---|
[b01aed9] | 73 | /* defaults for things that are the same for most OS */ |
---|
| 74 | |
---|
[d1b1380] | 75 | # ifndef init_screen |
---|
| 76 | # define init_screen() /* ie do nothing special */ |
---|
| 77 | # endif /* !init_screen */ |
---|
| 78 | |
---|
| 79 | /* prototypes for functions in osdepend.c */ |
---|
[a9f5117] | 80 | bool fAbsoluteFnm(const char *fnm); |
---|
| 81 | bool fDirectory(const char *fnm); |
---|
[a420b49] | 82 | |
---|
| 83 | # ifndef HAVE_DIFFTIME |
---|
| 84 | # define difftime(A, B) ((B)-(A)) |
---|
| 85 | # endif |
---|
[d1b1380] | 86 | |
---|
| 87 | #endif /* !OSDEPEND_H */ |
---|