Blame src/include/mpii_fortlogical.h

Packit Service c5cf8c
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
Packit Service c5cf8c
/*
Packit Service c5cf8c
 *  (C) 2001 by Argonne National Laboratory.
Packit Service c5cf8c
 *      See COPYRIGHT in top-level directory.
Packit Service c5cf8c
 */
Packit Service c5cf8c
Packit Service c5cf8c
#ifndef MPII_FORTLOGICAL_H_INCLUDED
Packit Service c5cf8c
#define MPII_FORTLOGICAL_H_INCLUDED
Packit Service c5cf8c
Packit Service c5cf8c
/* Fortran logical values */
Packit Service c5cf8c
#ifndef _CRAY
Packit Service c5cf8c
#ifdef F77_USE_BOOLEAN_LITERALS
Packit Service c5cf8c
#define MPII_F_TRUE  F77_TRUE_VALUE
Packit Service c5cf8c
#define MPII_F_FALSE F77_FALSE_VALUE
Packit Service c5cf8c
#else
Packit Service c5cf8c
#if !defined(F77_RUNTIME_VALUES) && defined(F77_TRUE_VALUE_SET)
Packit Service c5cf8c
MPICH_API_PUBLIC extern const MPI_Fint MPII_F_TRUE, MPII_F_FALSE;
Packit Service c5cf8c
#else
Packit Service c5cf8c
MPICH_API_PUBLIC extern MPI_Fint MPII_F_TRUE, MPII_F_FALSE;
Packit Service c5cf8c
#endif
Packit Service c5cf8c
#endif
Packit Service c5cf8c
#define MPII_TO_FLOG(a) ((a) ? MPII_F_TRUE : MPII_F_FALSE)
Packit Service c5cf8c
/*
Packit Service c5cf8c
   Note on true and false.  This code is only an approximation.
Packit Service c5cf8c
   Some systems define either true or false, and allow some or ALL other
Packit Service c5cf8c
   patterns for the other.  This is just like C, where 0 is false and
Packit Service c5cf8c
   anything not zero is true.  Modify this test as necessary for your
Packit Service c5cf8c
   system.
Packit Service c5cf8c
Packit Service c5cf8c
   We check against FALSE instead of TRUE because many (perhaps all at this
Packit Service c5cf8c
   point) Fortran compilers use 0 for false and some non-zero value for
Packit Service c5cf8c
   true.  By using this test, it is possible to use the same Fortran
Packit Service c5cf8c
   interface library for multiple compilers that differ only in the
Packit Service c5cf8c
   value used for Fortran .TRUE. .
Packit Service c5cf8c
 */
Packit Service c5cf8c
#define MPII_FROM_FLOG(a) ((a) == MPII_F_FALSE ? 0 : 1)
Packit Service c5cf8c
Packit Service c5cf8c
#else
Packit Service c5cf8c
/* CRAY Vector processors only; these are defined in /usr/include/fortran.h
Packit Service c5cf8c
   Thanks to lmc@cray.com */
Packit Service c5cf8c
#define MPII_TO_FLOG(a) (_btol(a))
Packit Service c5cf8c
#define MPII_FROM_FLOG(a) (_ltob(&(a))) /* (a) must be a pointer */
Packit Service c5cf8c
#endif
Packit Service c5cf8c
Packit Service c5cf8c
#endif /* MPII_FORTLOGICAL_H_INCLUDED */