1 #ifndef __ENVDEPS_H
2 #define __ENVDEPS_H
3 
4 #define PROGRAMID "Diskpoll 0.1.4 (dev)"
5 
6 // ------- OS/2 or NT with any other compiler except EMX -------
7 #if ((defined(__OS2__) || defined(__NT__) || defined(OS2) || defined(NT) || defined(WINNT)) && (!defined(__EMX__)))
8 #error "EMX GCC required under OS/2, RSX required unter NT"
9 
10 
11 // ------- EMX settings for OS/2 or NT -------
12 #elif (defined(__EMX__))
13 #if (!defined(__OS2__)) && (!defined(__NT__)) && (!defined(OS2)) && (!defined(NT)) && (!defined(WINNT))
14 #error "Only OS/2 or NT platforms supported for EMX gcc"
15 #else
16 #define VSNPRINTF(a,b,c,d) vsnprintf(a,b,c,d)    // emx as vsnprintf!
17 
18 // #define NEED_GETOPTH
19 // pgcc getopt.h has getopt prototype with empty args list - this won't
20 // work for C++, so we need our own prototypes
21 extern "C" {
22 int getopt (int argc, char *const *argv, const char *shortopts);
23 extern char *optarg;
24 extern int optind;
25 extern int opterr;
26 extern int optopt;
27 }
28 
29 //#define SHORTINCLUDEFILENAMES  // use strstrea.h, not strstream.h
30 #define DEFDIRSEP '\\'
31 #ifndef CFGDIR
32 #define CFGDIR "."
33 #endif
34 #define ALLFILES "*"
35 #include <stdlib.h> /* mkdir */
36 #define mymkdir(a) mkdir((a), 0)
37 #endif
38 
39 
40 // ------- These settings are for DOS/DPMI with DJGPP v2  -------
41 #elif defined __DJGPP__
42 #define VSNPRINTF(a,b,c,d) vsprintf(a,c,d)
43 #define NEED_UNISTDH
44 #define DEFDIRSEP '\\'
45 #ifndef CFGDIR
46 #define CFGDIR "."
47 #endif
48 #define ALLFILES "*"
49 #include <sys/stat.h> /* mkdir */
50 #define mymkdir(a) mkdir((a), 0)
51 
52 // ------- DOS with any other compiler -------
53 #elif defined(__DOS__) || defined(DOS)
54 #error "The DOS version requires DJGPP as compiler!"
55 
56 // ------- These settings are for Unix (FreeBSD, AIX, Linux, ...) -------
57 #else
58 #define UNIXLIKE
59 #ifdef  HAVE_VSNPRINTF
60 #define VSNPRINTF(a,b,c,d) vsnprintf(a,b,c,d)
61 #else
62 #define VSNPRINTF(a,b,c,d) vsprintf(a,c,d)
63 #endif
64 #if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
65 #define NEED_GETOPTH
66 #endif
67 #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
68 #define NEED_UNISTDH
69 #endif
70 //#define SHORTINCLUDEFILENAMES
71 #define DEFDIRSEP '/'
72 #ifndef CFGDIR
73 #define CFGDIR "/usr/local/etc"
74 #endif
75 #define ALLFILES "*"
76 #include <sys/stat.h> /* for mkdir */
77 #if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(_AIX) || defined(__osf__) || defined(__GLIBC__)
78 #define mymkdir(a) mkdir((a), 0777)
79 #else
80 #define mymkdir(a) __mkdir((a), 0777)
81 #endif
82 #endif
83 
84 #define DEFCONFIGFILE CFGDIR"/diskpoll.cfg"
85 
86 #endif
87 
88