Cleanups for the windows helpers. They will get included on the next commit.
This commit was SVN r8533.
Этот коммит содержится в:
родитель
f9b07f1912
Коммит
08d33cfd52
@ -17,15 +17,15 @@
|
||||
*/
|
||||
|
||||
#include "ompi_config.h"
|
||||
#include "win32/ompi_time.h"
|
||||
#include "opal/win32/ompi_time.h"
|
||||
|
||||
#ifdef WIN32
|
||||
# include<time.h>
|
||||
#endif
|
||||
#include<time.h>
|
||||
|
||||
#define EPOCHFILETIME (116444736000000000LL)
|
||||
|
||||
int gettimeofday(struct timeval *tv, struct timezone *tz) {
|
||||
OMPI_DECLSPEC int
|
||||
gettimeofday(struct timeval *tv, struct timezone *tz)
|
||||
{
|
||||
|
||||
FILETIME file_time;
|
||||
LARGE_INTEGER place_holder;
|
||||
|
@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
#include "ompi_config.h"
|
||||
#include "win32/ompi_uio.h"
|
||||
#include "opal/win32/ompi_uio.h"
|
||||
#include <errno.h>
|
||||
|
||||
/*
|
||||
@ -26,33 +26,33 @@
|
||||
of code to handle the windows error flags
|
||||
*/
|
||||
|
||||
int
|
||||
writev(int fd,struct iovec * iov,int cnt)
|
||||
OMPI_DECLSPEC int
|
||||
writev( int fd, struct iovec * iov, int cnt )
|
||||
{
|
||||
int err;
|
||||
DWORD sendlen;
|
||||
int err;
|
||||
DWORD sendlen;
|
||||
|
||||
err = WSASend((SOCKET) fd, &(iov->data), cnt, &sendlen, 0, NULL, NULL);
|
||||
err = WSASend((SOCKET) fd, &(iov->data), cnt, &sendlen, 0, NULL, NULL);
|
||||
|
||||
if (err < 0) {
|
||||
return err;
|
||||
} else {
|
||||
return (int) sendlen;
|
||||
}
|
||||
if (err < 0) {
|
||||
return err;
|
||||
}
|
||||
return (int) sendlen;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
readv(int fd,struct iovec * iov,int cnt)
|
||||
OMPI_DECLSPEC int
|
||||
readv( int fd, struct iovec * iov, int cnt )
|
||||
{
|
||||
int err;
|
||||
DWORD recvlen = 0;
|
||||
DWORD flags = 0;
|
||||
|
||||
err = WSARecv((SOCKET) fd, &(iov->data), cnt, &recvlen, &flags, NULL, NULL);
|
||||
|
||||
if (err < 0) {
|
||||
if( err < 0 ) {
|
||||
return err;
|
||||
} else {
|
||||
return (int) recvlen;
|
||||
}
|
||||
return (int) recvlen;
|
||||
}
|
||||
|
||||
|
@ -21,15 +21,16 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
static __inline int getpagesize(void) {
|
||||
static __inline int getpagesize(void)
|
||||
{
|
||||
SYSTEM_INFO sys_info;
|
||||
|
||||
GetSystemInfo(&sys_info);
|
||||
return (int)sys_info.dwPageSize;
|
||||
}
|
||||
|
||||
|
||||
static __inline char *basename(char *path) {
|
||||
static __inline char *basename(char *path)
|
||||
{
|
||||
char *p = path;
|
||||
char *ret;
|
||||
|
||||
@ -52,8 +53,8 @@ static __inline char *dirname(char *path) {
|
||||
char *dirname;
|
||||
char *base;
|
||||
|
||||
base = basename(path);
|
||||
dirname = _strdup(path);
|
||||
base = basename(path);
|
||||
dirname = _strdup(path);
|
||||
|
||||
strncpy(dirname, path, strlen(path)-strlen(base));
|
||||
dirname[strlen(path)-strlen(base)] = '\0';
|
||||
|
@ -17,13 +17,7 @@
|
||||
*/
|
||||
|
||||
#include "ompi_config.h"
|
||||
#include "ompi_utsname.h"
|
||||
|
||||
#ifdef WIN32
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
# undef WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include "opal/win32/ompi_utsname.h"
|
||||
|
||||
/*
|
||||
This has to fill in the following information
|
||||
@ -35,7 +29,9 @@
|
||||
5. machine: GetSystemInfo
|
||||
*/
|
||||
|
||||
int uname (struct utsname *un) {
|
||||
OMPI_DECLSPEC int
|
||||
uname( struct utsname *un )
|
||||
{
|
||||
|
||||
/* 1. get the OS name */
|
||||
TCHAR env_variable[] = "OS=%OS%";
|
||||
|
@ -39,7 +39,7 @@ struct utsname {
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
int uname(struct utsname *un);
|
||||
OMPI_DECLSPEC int uname(struct utsname *un);
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
@ -35,21 +35,10 @@
|
||||
#define FD_SETSIZE 1024
|
||||
|
||||
/* other utility header files */
|
||||
#include <cderr.h>
|
||||
#include <dde.h>
|
||||
#include <ddeml.h>
|
||||
#include <dlgs.h>
|
||||
#include <imm.h>
|
||||
#include <lzexpand.h>
|
||||
#include <mmsystem.h>
|
||||
#include <nb30.h>
|
||||
#include <rpc.h>
|
||||
#if !defined(__cplusplus)
|
||||
#include <shellapi.h>
|
||||
#include <winperf.h>
|
||||
#include <winsock2.h>
|
||||
/*#include <ws2tcpip.h>*/
|
||||
#include <process.h>
|
||||
/*#include <io.h>*/
|
||||
#include <signal.h>
|
||||
/*#if defined(OMPI_BUILDING) && OMPI_BUILDING */
|
||||
#include "win32/ompi_uio.h"
|
||||
@ -59,15 +48,30 @@
|
||||
#include "win32/ompi_misc.h"
|
||||
#include "opal/util/printf.h"
|
||||
/*#endif*/
|
||||
#endif /* !defined(__cplusplus) */
|
||||
|
||||
#define MAXPATHLEN MAX_PATH
|
||||
#define MAXHOSTNAMELEN MAX_PATH
|
||||
#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
|
||||
typedef unsigned short mode_t;
|
||||
typedef long ssize_t;
|
||||
typedef DWORD in_port_t;
|
||||
typedef int caddr_t;
|
||||
typedef unsigned int uint;
|
||||
|
||||
/* 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)
|
||||
|
||||
/* 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
|
||||
@ -87,7 +91,9 @@ typedef unsigned int uint;
|
||||
#define HAVE_DECL___FUNC__ 1
|
||||
|
||||
/* Microsoft claim that strdup is deprecated and that we should use _strdup. */
|
||||
#define strdup _strdup
|
||||
/*#define strdup _strdup*/
|
||||
/*#define strncpy strncpy_s*/
|
||||
/*#define sprintf sprintf_s*/
|
||||
|
||||
/* Ugly signal mapping since windows doesn't support the full spectrum
|
||||
* just a very small subset... :/
|
||||
@ -108,7 +114,7 @@ typedef unsigned int uint;
|
||||
#define sigset_t int
|
||||
|
||||
/*
|
||||
* Mask these to Windows equlivants
|
||||
* Mask these to Windows equivalents
|
||||
*/
|
||||
#define bzero(p, l) memset(p, 0, l)
|
||||
#define bcopy(s, t, l) memmove(t, s, l)
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user