1 /* $RCSfile: extern.h,v $
3 -- last change: $Author: kz $ $Date: 2008-03-05 18:28:27 $
6 -- External declarations for dmake functions.
9 -- ANSI is a macro that allows the proper handling of ANSI style
10 -- function declarations.
13 -- Dennis Vadura, dvadura@dmake.wticorp.com
16 -- http://dmake.wticorp.com/
19 -- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
21 -- This program is NOT free software; you can redistribute it and/or
22 -- modify it under the terms of the Software License Agreement Provided
23 -- in the file <distribution-root>/readme/license.txt.
26 -- Use cvs log to obtain detailed change logs.
32 /* For MSVC++ needs to include windows.h first to avoid problems with
33 * type redefinitions. Include it also for MinGW for consistency. */
34 #if defined(__MINGW32__) || defined(_MSC_VER)
40 /* Define this for the RS/6000 if it breaks something then we have to put a
41 * #ifdef around it. */
60 #if TIME_WITH_SYS_TIME
61 # include <sys/time.h>
65 # include <sys/time.h>
72 # include <sys/types.h>
77 # include <sys/stat.h>
83 #define DMPVOID void *
96 /* Include this last as it invalidates some functions that are defined
97 * externally above and turns them into no-ops. Have to do this after
98 * the extern declarations however. */
103 /* Common declarations
104 * ===================
105 * are better made here then in local public.h. So far dmake didn't follow
106 * this strategy but new functions will be added here. */
108 /* Use our own implementation if no library function is present. */
110 /* from dmstring.c */
111 char *strlwr(char *p
);
114 /* from function.c */
115 char *exec_normpath(char *args
);
118 void Unmake(CELLPTR cp
);
121 void Clean_path(char *path
);
122 char *normalize_path(char *path
);
125 /* cygdospath()/DO_WINPATH() are only needed for the .WINPATH attribute
128 char *cygdospath(char *src
, int winpath
);
129 # define DO_WINPATH(p) cygdospath(p, UseWinpath)
131 # define DO_WINPATH(p) p
135 /* Define some usefull macros. This is done here and not in config.h
136 * to keep this changes usefull even when not using the autotools based
137 * build, i.e. using config.h files that are local to the architecture. */
138 #if defined(_WIN32) || defined(__CYGWIN__) || defined(MSDOS) || defined(OS2) || defined(__EMX__)
139 # define HAVE_DRIVE_LETTERS 1
142 #if defined(_WIN32) || defined(MSDOS) || defined(OS2) && !defined(__CYGWIN__)
143 # define NULLDEV "NUL"
145 # define NULLDEV "/dev/null"
148 /* For MSVC 6.0 and newer and MinGW use the CreateProcess() function. */
149 #if defined(__MINGW32__) || defined(_MSC_VER) && _MSC_VER >= 1200
150 # define USE_CREATEPROCESS 1
152 /* #undef USE_CREATEPROCESS */
155 /* CreateProcess() is spawn-like. */
156 #if ENABLE_SPAWN && ( HAVE_SPAWN_H || __CYGWIN__ || __EMX__) || defined(USE_CREATEPROCESS)
159 /* #undef USE_SPAWN */
162 /* Work around some of the functions that may or may not exist */
165 # define tzset() settz()
167 # warn "tzset is not supported, null out"
172 /* Get the working directory fall back code */
175 # define getcwd(buf,len) getwd(buf)
177 # error "You have no supported way of getting working directory"
181 /* If setvbuf is not available set output to unbuffered */
183 # define setvbuf(fp,bp,type,len) setbuf(fp,NULL)
186 /* coreleft is used in some debug macros. Only Turbo C seems to provide
187 * this function. Define it here so that the code compiles. */
189 #define coreleft() 0L