diff host/tools/Utils/common/eCosStd.h @ 76:435cced73e2f ecos-v1_3_1-release

eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
author jlarmour
date Tue, 28 Mar 2000 14:10:45 +0000
parents
children 6736c52df507
line wrap: on
line diff
new file mode 100644
--- /dev/null
+++ b/host/tools/Utils/common/eCosStd.h
@@ -0,0 +1,156 @@
+//####COPYRIGHTBEGIN####
+//                                                                          
+// ----------------------------------------------------------------------------
+// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
+//
+// This program is part of the eCos host tools.
+//
+// This program is free software; you can redistribute it and/or modify it 
+// under the terms of the GNU General Public License as published by the Free 
+// Software Foundation; either version 2 of the License, or (at your option) 
+// any later version.
+// 
+// This program is distributed in the hope that it will be useful, but WITHOUT 
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+// more details.
+// 
+// You should have received a copy of the GNU General Public License along with
+// this program; if not, write to the Free Software Foundation, Inc., 
+// 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// ----------------------------------------------------------------------------
+//                                                                          
+//####COPYRIGHTEND####
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):     sdf
+// Contributors:  sdf
+// Date:          1999-04-01
+// Description:   Standard include file for test infra
+// Usage:
+//
+//####DESCRIPTIONEND####
+
+#if !defined(AFX_STDAFX_H__F20BA9C4_CFD5_11D2_BF75_00A0C949ADAC__INCLUDED_)
+#define AFX_STDAFX_H__F20BA9C4_CFD5_11D2_BF75_00A0C949ADAC__INCLUDED_
+
+#ifndef CYG_UNUSED_PARAM
+  #ifdef _WIN32
+    #define CYG_UNUSED_PARAM( _name_ ) _name_
+  #else // UNIX
+    #define CYG_UNUSED_PARAM( _name_ ) { void * __tmp1 = &(_name_); __tmp1 = 0; }
+  #endif
+#endif
+
+#ifdef _WIN32
+  #ifdef _UNICODE
+    #ifndef UNICODE
+      #define UNICODE         // UNICODE is used by Windows headers
+    #endif
+  #endif
+
+  #include <tchar.h>
+  #undef NDEBUG
+
+  #if _MSC_VER > 1000
+    #pragma once
+  #endif // _MSC_VER > 1000
+
+  #define VC_EXTRALEAN		// Exclude rarely-used stuff from Windows headers
+
+  #include <winsock2.h>
+  #ifndef _WINDOWS_
+    #include <windows.h>
+  #endif
+  #include <sys/types.h>
+  #include <sys/stat.h>
+  #include <direct.h>
+  #define cPathsep _TCHAR('\\')
+  #include <io.h>
+  #include <process.h>
+
+  #include <io.h>
+  #define POPEN _tpopen    
+  #define PCLOSE _pclose    
+  #include <malloc.h> // _heapchk
+  //#define CHECKHEAP CeCosTestUtils::EnterCriticalSection();assert(_HEAPOK==_heapchk());CeCosTestUtils::LeaveCriticalSection()
+  #define CHECKHEAP assert(_HEAPOK==_heapchk())
+  #define CLOSESOCKET(s) if(-1!=s)closesocket(s);s=-1
+
+  #define CALLBACK    __stdcall               // Calling conventions for a callback
+  #define WOULDBLOCK WSAEWOULDBLOCK           // "Would blocking" error
+  #define errno       (*_errno())
+  #define vsnprintf _vsnprintf
+  #define Sleep(mSec) ::Sleep(mSec)
+  #pragma warning (disable:4710)  // Not inlined warning
+  typedef __int64 Time;
+#else // UNIX
+  #include <termios.h>
+  #include <unistd.h>
+  #include <sys/types.h>
+  #include <sys/wait.h>
+  #include <dirent.h>
+  #include <sys/stat.h>
+  #include <sys/file.h>
+  #include <unistd.h>
+  #include <sys/socket.h> // socket etc...
+  #include <netinet/in.h> // inet_addr
+  #include <arpa/inet.h>  // inet_addr
+  #include <netdb.h>      // gethostbyname
+  #include <sys/time.h>
+  #include <sys/timeb.h>
+  #include <signal.h>
+  #include <fcntl.h>
+  #define cPathsep '/'
+  #include <malloc.h>     // malloc   
+  #include <stdlib.h>     // atoi
+  #include <errno.h>
+  #define POPEN popen    
+  #define PCLOSE pclose    
+  #define CHECKHEAP
+  #define CLOSESOCKET(s) if(-1!=s)close(s);s=-1
+  #define WOULDBLOCK EWOULDBLOCK
+  #define CALLBACK
+
+  #include "wcharunix.h"
+
+  #define _stat stat
+  #define Sleep(nMsec) usleep((int)nMsec * 1000);
+  typedef long long Time;
+#endif
+
+#define ECOS_VERSION "1.3.2"
+
+typedef int Duration;
+
+extern Time Now();
+
+// do not use macros, which would lead to double argument evaluation:
+extern int MIN(int a, int b);
+extern int MAX(int a, int b);
+
+#include <string.h>
+
+#include <time.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <ctype.h>
+#include <fcntl.h>
+#include <string.h>
+#include <assert.h>
+#include <malloc.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <time.h>
+#include <stdarg.h>     // vsnprintf
+
+#include <assert.h> // assert
+#include <string.h> // strcpy
+#include <stdarg.h>
+#include <stdio.h>
+
+// Allow user to define a function to which logged output is sent (in addition to being stored internally)
+typedef void (CALLBACK LogFunc)(void *, LPCTSTR );
+
+#endif