fenv.hh revision 2665
11858SN/A/*
21858SN/A * Copyright (c) 2004-2005 The Regents of The University of Michigan
31858SN/A * All rights reserved.
41858SN/A *
51858SN/A * Redistribution and use in source and binary forms, with or without
61858SN/A * modification, are permitted provided that the following conditions are
71858SN/A * met: redistributions of source code must retain the above copyright
81858SN/A * notice, this list of conditions and the following disclaimer;
91858SN/A * redistributions in binary form must reproduce the above copyright
101858SN/A * notice, this list of conditions and the following disclaimer in the
111858SN/A * documentation and/or other materials provided with the distribution;
121858SN/A * neither the name of the copyright holders nor the names of its
131858SN/A * contributors may be used to endorse or promote products derived from
141858SN/A * this software without specific prior written permission.
151858SN/A *
161858SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
171858SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
181858SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
191858SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
201858SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
211858SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
221858SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
231858SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
241858SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
251858SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
261858SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272665Ssaidi@eecs.umich.edu *
282665Ssaidi@eecs.umich.edu * Authors: Steve Reinhardt
291858SN/A */
301858SN/A
311858SN/A#ifndef __BASE_FENV_HH__
321858SN/A#define __BASE_FENV_HH__
331858SN/A
341858SN/A#include "config/use_fenv.hh"
351858SN/A
361858SN/A#if USE_FENV
371858SN/A
381858SN/A#include <fenv.h>
391858SN/A
401858SN/A#else
411858SN/A
421858SN/A// Dummy definitions to allow code to compile w/o a real <fenv.h>.
431858SN/A
441858SN/A#define FE_TONEAREST    0
451858SN/A#define FE_DOWNWARD     0
461858SN/A#define FE_UPWARD       0
471858SN/A#define FE_TOWARDZERO   0
481858SN/A
491858SN/Ainline int fesetround(int rounding_mode) { return 0; }
501858SN/A
511858SN/A#endif // USE_FENV
521858SN/A
531858SN/A
541858SN/A#endif // __BASE_FENV_HH__
55