2004-10-14 00:21:07 +04:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2004-11-28 23:09:25 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-11-22 03:37:56 +03:00
|
|
|
* $HEADER$
|
2004-10-14 00:21:07 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef OMPI_WIN_COMPAT_H
|
|
|
|
#define OMPI_WIN_COMPAT_H
|
|
|
|
|
|
|
|
/* It is always better to include windows.h with the lean and mean option.
|
|
|
|
So, include it with that option and then include some which are required
|
|
|
|
for us in ompi. Note: this file is included only on windows */
|
|
|
|
|
|
|
|
#ifndef WIN32_LEAN_AND_MEAN
|
|
|
|
#define WIN32_LEAN_AND_MEAN
|
2004-10-22 20:06:05 +04:00
|
|
|
#include <windows.h>
|
2004-10-14 00:21:07 +04:00
|
|
|
#undef WIN32_LEAN_AND_MEAN
|
2004-10-22 20:06:05 +04:00
|
|
|
#endif
|
2004-10-14 00:21:07 +04:00
|
|
|
|
2005-01-20 03:03:23 +03:00
|
|
|
/* FD_SETSIZE determines how many sockets windows can select() on. If not defined
|
|
|
|
before including winsock2.h, it is defined to be 64. We are going to go ahead and
|
|
|
|
make it 1024 for now. PLEASE CHECK IF THIS IS RIGHT */
|
|
|
|
#define FD_SETSIZE 1024
|
|
|
|
|
2004-10-14 00:21:07 +04:00
|
|
|
/* other utility header files */
|
|
|
|
#include <shellapi.h>
|
|
|
|
#include <winsock2.h>
|
2005-12-31 15:23:28 +03:00
|
|
|
#include <ws2tcpip.h>
|
2004-10-28 22:13:43 +04:00
|
|
|
#include <process.h>
|
2005-04-13 06:29:33 +04:00
|
|
|
#include <signal.h>
|
2005-04-19 08:24:13 +04:00
|
|
|
/*#if defined(OMPI_BUILDING) && OMPI_BUILDING */
|
2006-02-27 05:15:53 +03:00
|
|
|
#include "opal/win32/ompi_uio.h"
|
|
|
|
#include "opal/win32/ompi_time.h"
|
|
|
|
#include "opal/win32/ompi_utsname.h"
|
|
|
|
#include "opal/win32/ompi_util.h"
|
|
|
|
#include "opal/win32/ompi_misc.h"
|
2005-07-04 06:16:57 +04:00
|
|
|
#include "opal/util/printf.h"
|
2005-04-19 08:24:13 +04:00
|
|
|
/*#endif*/
|
2005-12-18 01:07:04 +03:00
|
|
|
|
|
|
|
#define MAXPATHLEN _MAX_PATH
|
|
|
|
#define MAXHOSTNAMELEN _MAX_PATH
|
|
|
|
#define PATH_MAX _MAX_PATH
|
|
|
|
#define STDIN_FILENO 0
|
|
|
|
#define STDOUT_FILENO 1
|
|
|
|
#define STDERR_FILENO 2
|
2004-10-14 00:21:07 +04:00
|
|
|
typedef unsigned short mode_t;
|
|
|
|
typedef long ssize_t;
|
2004-10-28 22:13:43 +04:00
|
|
|
typedef DWORD in_port_t;
|
2005-01-20 03:03:23 +03:00
|
|
|
typedef int caddr_t;
|
|
|
|
typedef unsigned int uint;
|
2004-10-14 00:21:07 +04:00
|
|
|
|
2005-12-18 01:07:04 +03:00
|
|
|
/* Defines for the access functions */
|
|
|
|
#define F_OK 0x00
|
|
|
|
#define R_OK 0x02
|
|
|
|
#define W_OK 0x04
|
|
|
|
#define X_OK 0x06
|
|
|
|
#define WTERMSIG(EXIT_CODE) (1)
|
|
|
|
#define WIFEXITED(EXIT_CODE) (1)
|
|
|
|
#define WEXITSTATUS(EXIT_CODE) (1)
|
|
|
|
#define WIFSIGNALED(EXIT_CODE) (0)
|
2005-12-22 03:10:56 +03:00
|
|
|
#define WIFSTOPPED(EXIT_CODE) (0)
|
|
|
|
#define WSTOPSIG(EXIT_CODE) (11)
|
2005-12-18 01:07:04 +03:00
|
|
|
|
2004-10-14 00:21:07 +04:00
|
|
|
/* Anju: some random #defines which I know offhand, but need to configure it */
|
|
|
|
#define OMPI_ALIGNMENT_CXX_BOOL OMPI_ALIGNMENT_INT
|
|
|
|
#define SIZEOF_BOOL SIZEOF_INT
|
2004-10-28 22:13:43 +04:00
|
|
|
#define getpid _getpid
|
|
|
|
#define getcwd _getcwd
|
|
|
|
#define mkdir _mkdir
|
2004-10-22 20:06:05 +04:00
|
|
|
|
|
|
|
#define UINT32_MAX _UI32_MAX
|
2005-12-13 09:17:15 +03:00
|
|
|
#define INT32_MAX _I32_MAX
|
|
|
|
#define UINT8_MAX _UI8_MAX
|
2005-04-11 07:43:35 +04:00
|
|
|
|
2005-04-11 09:00:26 +04:00
|
|
|
#define SIZEOF_SIZE_T 4
|
2005-12-13 09:17:15 +03:00
|
|
|
|
|
|
|
/* If we now support __func__ set the HAVE_DECL___FUNC__ */
|
2005-04-11 07:43:35 +04:00
|
|
|
#define __func__ __FUNCTION__
|
2005-12-13 09:17:15 +03:00
|
|
|
#undef HAVE_DECL___FUNC__
|
|
|
|
#define HAVE_DECL___FUNC__ 1
|
|
|
|
|
|
|
|
/* Microsoft claim that strdup is deprecated and that we should use _strdup. */
|
2005-12-18 01:07:04 +03:00
|
|
|
/*#define strdup _strdup*/
|
|
|
|
/*#define strncpy strncpy_s*/
|
|
|
|
/*#define sprintf sprintf_s*/
|
2004-10-22 20:06:05 +04:00
|
|
|
|
2005-04-12 09:40:19 +04:00
|
|
|
/* Ugly signal mapping since windows doesn't support the full spectrum
|
|
|
|
* just a very small subset... :/
|
|
|
|
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_raise.asp
|
2005-06-22 02:48:57 +04:00
|
|
|
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnucmg/html/UCMGch09.asp
|
2005-04-12 09:40:19 +04:00
|
|
|
*/
|
|
|
|
#define SIGCHLD SIGILL
|
2005-06-22 02:48:57 +04:00
|
|
|
#define SIGKILL WM_QUIT
|
2005-04-12 09:40:19 +04:00
|
|
|
|
|
|
|
/* Note:
|
|
|
|
* The two defines below are likely to break the orte_wait
|
|
|
|
* functionality. The proper method of replacing these bits
|
|
|
|
* of functionality is left for further investigated.
|
|
|
|
*/
|
|
|
|
#define WUNTRACED 0
|
|
|
|
#define WNOHANG 0
|
|
|
|
|
2005-04-13 06:29:33 +04:00
|
|
|
#define sigset_t int
|
|
|
|
|
2005-06-14 00:28:44 +04:00
|
|
|
/*
|
2005-12-18 01:07:04 +03:00
|
|
|
* Mask these to Windows equivalents
|
2005-06-14 00:28:44 +04:00
|
|
|
*/
|
|
|
|
#define bzero(p, l) memset(p, 0, l)
|
|
|
|
#define bcopy(s, t, l) memmove(t, s, l)
|
|
|
|
|
2004-10-14 00:21:07 +04:00
|
|
|
#endif /* compat */
|