1
1
This commit was SVN r8482.
Этот коммит содержится в:
George Bosilca 2005-12-13 06:13:25 +00:00
родитель 4723334d3c
Коммит c065f23a4a

Просмотреть файл

@ -132,8 +132,14 @@ typedef struct {
* Windows library interface declaration code * Windows library interface declaration code
* *
**********************************************************************/ **********************************************************************/
#ifndef __WINDOWS__
# if defined(_WIN32) || defined(WIN32)
# define __WINDOWS__
# endif
#endif
#if defined(__WINDOWS__)
#if defined(_WIN32)
# if OMPI_BUILDING # if OMPI_BUILDING
# include "win32/win_compat.h" # include "win32/win_compat.h"
# endif # endif
@ -142,15 +148,17 @@ typedef struct {
struct */ struct */
# define OMPI_COMP_EXPORT __declspec(dllexport) # define OMPI_COMP_EXPORT __declspec(dllexport)
# define OMPI_DECLSPEC __declspec(dllimport) # define OMPI_DECLSPEC __declspec(dllimport)
# elif OMPI_BUILDING
/* building libmpi (or something in libmpi) - need to export libmpi
interface */
# define OMPI_COMP_EXPORT
# define OMPI_DECLSPEC __declspec(dllexport)
# else # else
/* building something using libmpi - export the libmpi interface */ # if OMPI_BUILDING
# define OMPI_COMP_EXPORT /* building libmpi (or something in libmpi) - need to export libmpi
# define OMPI_DECLSPEC __declspec(dllimport) interface */
# define OMPI_COMP_EXPORT
# define OMPI_DECLSPEC __declspec(dllexport)
# else
/* building something using libmpi - export the libmpi interface */
# define OMPI_COMP_EXPORT
# define OMPI_DECLSPEC __declspec(dllimport)
# endif
# endif # endif
#else #else
/* On Unix - get rid of the defines */ /* On Unix - get rid of the defines */
@ -158,7 +166,6 @@ typedef struct {
# define OMPI_DECLSPEC # define OMPI_DECLSPEC
#endif #endif
/*********************************************************************** /***********************************************************************
* *
* Code that is only for when building Open MPI or utilities that are * Code that is only for when building Open MPI or utilities that are
@ -180,7 +187,7 @@ typedef struct {
assumption that the C++ bool is the same size and has assumption that the C++ bool is the same size and has
the same alignment. */ the same alignment. */
# include <stdbool.h> # include <stdbool.h>
# elif defined(_WIN32) # elif defined(__WINDOWS__)
# define bool BOOL # define bool BOOL
# define false FALSE # define false FALSE
# define true TRUE # define true TRUE
@ -222,7 +229,7 @@ typedef long long bool;
/* /*
* Set the compile-time path-separator on this system * Set the compile-time path-separator on this system
*/ */
#ifdef WIN32 #ifdef __WINDOWS__
#define OMPI_PATH_SEP "\\" #define OMPI_PATH_SEP "\\"
#else #else
#define OMPI_PATH_SEP "/" #define OMPI_PATH_SEP "/"
@ -343,8 +350,10 @@ typedef long long bool;
* On some homogenous big-iron machines (Sandia's Red Storm), there * On some homogenous big-iron machines (Sandia's Red Storm), there
* are no htonl and friends. If that's the case, provide stubs. I * are no htonl and friends. If that's the case, provide stubs. I
* would hope we never find a platform that doesn't have these macros * would hope we never find a platform that doesn't have these macros
* and would want to talk to the outside world... * and would want to talk to the outside world... On other platforms
* (like Windows) we fail to detect them correctly.
*/ */
#ifndef __WINDOWS__
#ifndef HAVE_HTONL #ifndef HAVE_HTONL
static inline uint32_t htonl(uint32_t hostvar) { return hostvar; } static inline uint32_t htonl(uint32_t hostvar) { return hostvar; }
#endif #endif
@ -357,7 +366,7 @@ static inline uint16_t htons(uint16_t hostvar) { return hostvar; }
#ifndef HAVE_NTOHS #ifndef HAVE_NTOHS
static inline uint16_t ntohs(uint16_t netvar) { return netvar; } static inline uint16_t ntohs(uint16_t netvar) { return netvar; }
#endif #endif
#endif /* WINDOWS */
/* /*
* Define __func__-preprocessor directive if the compiler does not * Define __func__-preprocessor directive if the compiler does not