root/morphix/trunk/cloop/advancecomp-1.9_create_compressed_fs/portable.h

Revision 2, 2.5 kB (checked in by nextime, 2 years ago)

Initial import, branching from morphix svn

Line 
1 /*
2  * This file is part of the Advance project.
3  *
4  * Copyright (C) 2002 Andrea Mazzoleni
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  */
20
21 #ifndef __PORTABLE_H
22 #define __PORTABLE_H
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 #ifdef HAVE_CONFIG_H
29 #include <config.h>
30 #endif
31
32 /* ------------------------------------------------------------------------ */
33 /* getopt */
34
35 #if HAVE_GETOPT_H
36 #include <getopt.h>
37 #endif
38
39 #if HAVE_UNISTD_H
40 #include <unistd.h>
41 #endif
42
43 #if !HAVE_GETOPT
44 int getopt(int argc, char * const *argv, const char *options);
45 extern char *optarg;
46 extern int optind, opterr, optopt;
47 #endif
48
49 #if HAVE_GETOPT_LONG
50 #define SWITCH_GETOPT_LONG(a,b) a
51 #else
52 #define SWITCH_GETOPT_LONG(a,b) b
53 #endif
54
55 /* ------------------------------------------------------------------------ */
56 /* utime */
57
58 #include <time.h>
59
60 #if HAVE_UTIME_H
61 #include <utime.h>
62 #endif
63
64 #if HAVE_SYS_UTIME_H
65 #include <sys/utime.h>
66 #endif
67
68 /* ------------------------------------------------------------------------ */
69 /* directory separator */
70
71 #if defined(__MSDOS__) || defined(__WIN32__)
72 #define DIR_SEP ';'
73 #else
74 #define DIR_SEP ':'
75 #endif
76
77 /* ------------------------------------------------------------------------ */
78 /* mkdir */
79
80 #if defined(__WIN32__)
81 #define HAVE_FUNC_MKDIR_ONEARG
82 #endif
83
84 // ------------------------------------------------------------------------
85 // signal
86
87 #if !defined(__WIN32__)
88 #define HAVE_SIGHUP
89 #define HAVE_SIGQUIT
90 #endif
91
92 /* ------------------------------------------------------------------------ */
93 /* snprintf */
94
95 #if !HAVE_SNPRINTF
96 #include <sys/types.h>
97 int snprintf(char *str, size_t count, const char *fmt, ...);
98 #else
99 #include <stdio.h>
100 #endif
101
102 #if !HAVE_VSNPRINTF
103 #if HAVE_STDARG_H
104 #include <stdarg.h>
105 #else
106 #if HAVE_VARARGS_H
107 #include <varargs.h>
108 #endif
109 #endif
110 #include <sys/types.h>
111 int vsnprintf(char *str, size_t count, const char *fmt, va_list arg);
112 #else
113 #include <stdio.h>
114 #endif
115
116 #ifdef __cplusplus
117 }
118 #endif
119
120 #endif
121
Note: See TracBrowser for help on using the browser.