Merge pull request #6340 from jsquyres/pr/v4.0.x/make-mpi.h-a-little-friendlier-to-c++
v4.0.x: mpi.h.in: use C++ static_cast<> where appropriate
Этот коммит содержится в:
Коммит
40db950c7d
@ -9,7 +9,7 @@
|
|||||||
* University of Stuttgart. All rights reserved.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2007-2018 Cisco Systems, Inc. All rights reserved
|
* Copyright (c) 2007-2019 Cisco Systems, Inc. All rights reserved
|
||||||
* Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved.
|
* Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved.
|
||||||
* Copyright (c) 2009-2012 Oak Rigde National Laboratory. All rights reserved.
|
* Copyright (c) 2009-2012 Oak Rigde National Laboratory. All rights reserved.
|
||||||
* Copyright (c) 2011 Sandia National Laboratories. All rights reserved.
|
* Copyright (c) 2011 Sandia National Laboratories. All rights reserved.
|
||||||
@ -325,7 +325,11 @@
|
|||||||
* when building OMPI).
|
* when building OMPI).
|
||||||
*/
|
*/
|
||||||
#if !OMPI_BUILDING
|
#if !OMPI_BUILDING
|
||||||
|
#if defined(c_plusplus) || defined(__cplusplus)
|
||||||
|
#define OMPI_PREDEFINED_GLOBAL(type, global) (static_cast<type> (static_cast<void *> (&(global))))
|
||||||
|
#else
|
||||||
#define OMPI_PREDEFINED_GLOBAL(type, global) ((type) ((void *) &(global)))
|
#define OMPI_PREDEFINED_GLOBAL(type, global) ((type) ((void *) &(global)))
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#define OMPI_PREDEFINED_GLOBAL(type, global) ((type) &(global))
|
#define OMPI_PREDEFINED_GLOBAL(type, global) ((type) &(global))
|
||||||
#endif
|
#endif
|
||||||
@ -765,8 +769,13 @@ enum {
|
|||||||
*/
|
*/
|
||||||
#define MPI_INFO_ENV OMPI_PREDEFINED_GLOBAL(MPI_Info, ompi_mpi_info_env)
|
#define MPI_INFO_ENV OMPI_PREDEFINED_GLOBAL(MPI_Info, ompi_mpi_info_env)
|
||||||
|
|
||||||
|
#if defined(c_plusplus) || defined(__cplusplus)
|
||||||
|
#define MPI_STATUS_IGNORE (static_cast<MPI_Status *> (0))
|
||||||
|
#define MPI_STATUSES_IGNORE (static_cast<MPI_Status *> (0))
|
||||||
|
#else
|
||||||
#define MPI_STATUS_IGNORE ((MPI_Status *) 0)
|
#define MPI_STATUS_IGNORE ((MPI_Status *) 0)
|
||||||
#define MPI_STATUSES_IGNORE ((MPI_Status *) 0)
|
#define MPI_STATUSES_IGNORE ((MPI_Status *) 0)
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Special MPI_T handles
|
* Special MPI_T handles
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user