Blame lib/driver/portable.h

Packit dd8086
/*
Packit dd8086
  Copyright (C) 2006, 2008, 2011, 2012 Rocky Bernstein <rocky@gnu.org>
Packit dd8086
Packit dd8086
  This program is free software: you can redistribute it and/or modify
Packit dd8086
  it under the terms of the GNU General Public License as published by
Packit dd8086
  the Free Software Foundation, either version 3 of the License, or
Packit dd8086
  (at your option) any later version.
Packit dd8086
Packit dd8086
  This program is distributed in the hope that it will be useful,
Packit dd8086
  but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit dd8086
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit dd8086
  GNU General Public License for more details.
Packit dd8086
Packit dd8086
  You should have received a copy of the GNU General Public License
Packit dd8086
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit dd8086
*/
Packit dd8086
Packit dd8086
/* 
Packit dd8086
   This file contains definitions to fill in for differences or
Packit dd8086
   deficiencies to OS or compiler irregularities.  If this file is
Packit dd8086
   included other routines can be more portable.
Packit dd8086
*/
Packit dd8086

Packit dd8086
#ifndef CDIO_DRIVER_PORTABLE_H_
Packit dd8086
#define CDIO_DRIVER_PORTABLE_H_
Packit dd8086
Packit dd8086
#if defined(HAVE_CONFIG_H) && !defined(__CDIO_CONFIG_H__)
Packit dd8086
# include "config.h"
Packit dd8086
# define __CDIO_CONFIG_H__ 1
Packit dd8086
#endif
Packit dd8086
Packit dd8086
#if !defined(HAVE_FTRUNCATE)
Packit dd8086
# if defined (_WIN32)
Packit dd8086
#  define ftruncate chsize
Packit dd8086
# endif
Packit dd8086
#endif /*HAVE_FTRUNCATE*/
Packit dd8086
Packit dd8086
#if !defined(HAVE_SNPRINTF)
Packit dd8086
# if defined (_MSC_VER)
Packit dd8086
#  define snprintf _snprintf
Packit dd8086
# endif
Packit dd8086
#endif /*HAVE_SNPRINTF*/
Packit dd8086
Packit dd8086
#if !defined(HAVE_VSNPRINTF)
Packit dd8086
# if defined (_MSC_VER)
Packit dd8086
#  define vsnprintf _vsnprintf
Packit dd8086
# endif
Packit dd8086
#endif /*HAVE_SNPRINTF*/
Packit dd8086
Packit dd8086
#if !defined(HAVE_DRAND48) && defined(HAVE_RAND)
Packit dd8086
# define drand48()   (rand() / (double)RAND_MAX)
Packit dd8086
#endif
Packit dd8086
Packit dd8086
#endif /* CDIO_DRIVER_PORTABLE_H_ */