1 //####COPYRIGHTBEGIN####
3 // ----------------------------------------------------------------------------
4 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
6 // This program is part of the eCos host tools.
8 // This program is free software; you can redistribute it and/or modify it
9 // under the terms of the GNU General Public License as published by the Free
10 // Software Foundation; either version 2 of the License, or (at your option)
13 // This program is distributed in the hope that it will be useful, but WITHOUT
14 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18 // You should have received a copy of the GNU General Public License along with
19 // this program; if not, write to the Free Software Foundation, Inc.,
20 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 // ----------------------------------------------------------------------------
24 //####COPYRIGHTEND####
25 //#####DESCRIPTIONBEGIN####
30 // Description: Standard include file - include file
33 //####DESCRIPTIONEND####
35 // ----------------------------------------------------------------------------
36 // This header sets us up with what is generally needed, both for WIN32 and UNIX
37 // Apart from header includes it defines the time-related quantities:
38 // Time - type to measure an absolute time
39 // Duration - type to measure the difference between two times, or a delay
40 // Now() - the time now.
42 // LogFunc - a function to which output can be sent
43 // ----------------------------------------------------------------------------
45 #if !defined(AFX_STDAFX_H__F20BA9C4_CFD5_11D2_BF75_00A0C949ADAC__INCLUDED_)
46 #define AFX_STDAFX_H__F20BA9C4_CFD5_11D2_BF75_00A0C949ADAC__INCLUDED_
48 #if defined(__CYGWIN__)
56 #include <malloc.h> // malloc
57 #include <stdlib.h> // atoi
59 #define WOULDBLOCK WSAEWOULDBLOCK
61 #include "wcharunix.h"
66 typedef long long Time;
74 #define UNICODE // UNICODE is used by Windows headers
83 #endif // _MSC_VER > 1000
85 #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
92 #define cPathsep _TCHAR('\\')
96 #include <malloc.h> // _heapchk
98 #define CALLBACK __stdcall // Calling conventions for a callback
99 #define WOULDBLOCK WSAEWOULDBLOCK // "Would blocking" error
100 #define errno (*_errno())
101 #define vsnprintf _vsnprintf
102 #pragma warning (disable:4710) // Not inlined warning
103 typedef __int64 Time;
104 #define MODE_TEXT _T("t")
108 #include <sys/wait.h>
110 #include <sys/file.h>
111 #include <sys/socket.h> // socket etc...
112 #include <netinet/in.h> // inet_addr
113 #include <arpa/inet.h> // inet_addr
114 #include <netdb.h> // gethostbyname
115 #include <sys/timeb.h>
119 #include <malloc.h> // malloc
120 #include <stdlib.h> // atoi
122 #define WOULDBLOCK EWOULDBLOCK
125 #include "wcharunix.h"
126 #include <sys/time.h>
130 typedef long long Time;
134 #define ECOS_VERSION "2.0"
136 typedef int Duration;
140 // do not use macros, which would lead to double argument evaluation:
141 extern int MIN(int a, int b);
142 extern int MAX(int a, int b);
147 #include <sys/stat.h>
148 #include <sys/types.h>
155 #include <stdarg.h> // vsnprintf
157 #include <assert.h> // assert
158 #include <string.h> // strcpy
162 // Allow user to define a function to which logged output is sent (in addition to being stored internally)
163 typedef void (CALLBACK LogFunc)(void *, LPCTSTR );