~ubuntu-branches/ubuntu/edgy/libcdio/edgy-updates

« back to all changes in this revision

Viewing changes to lib/portable.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2005-11-15 16:53:23 UTC
  • mfrom: (3.1.1 etch)
  • Revision ID: james.westby@ubuntu.com-20051115165323-peroku75syl2j36u
Tags: 0.76-1ubuntu1
* Sync to new Debian version, manually apply Ubuntu patches:
  - debian/control: Remove dpkg-awk build dependency.
  - debian/rules: hardcode $LIBCDEV. This keeps the diff small (compared to
    the original patch of changing every ${libcdev} occurence).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
    $Id: portable.h,v 1.4 2004/11/07 21:13:10 rocky Exp $
3
 
 
4
 
    Copyright (C) Rocky Bernstein <rocky@panix.com>
5
 
 
6
 
    This program is free software; you can redistribute it and/or modify
7
 
    it under the terms of the GNU General Public License as published by
8
 
    the Free Software Foundation; either version 2 of the License, or
9
 
    (at your option) any later version.
10
 
 
11
 
    This program is distributed in the hope that it will be useful,
12
 
    but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
    GNU General Public License for more details.
15
 
 
16
 
    You should have received a copy of the GNU General Public License
17
 
    along with this program; if not, write to the Free Software
18
 
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
 
*/
20
 
 
21
 
/* 
22
 
   This file contains definitions to fill in for differences or
23
 
   deficiencies to OS or compiler irregularities.  If this file is
24
 
   included other routines can be more portable.
25
 
*/
26
 
 
27
 
#ifndef __CDIO_PORTABLE_H__
28
 
#define __CDIO_PORTABLE_H__
29
 
 
30
 
#ifdef HAVE_CONFIG_H
31
 
# include "config.h"
32
 
#endif
33
 
 
34
 
#if !defined(HAVE_FTRUNCATE)
35
 
# if defined ( WIN32 )
36
 
#  define ftruncate chsize
37
 
# endif
38
 
#endif /*HAVE_FTRUNCATE*/
39
 
 
40
 
#if !defined(HAVE_SNPRINTF)
41
 
# if defined ( MSVC )
42
 
#  define snprintf _snprintf
43
 
# endif
44
 
#endif /*HAVE_SNPRINTF*/
45
 
 
46
 
#if !defined(HAVE_VSNPRINTF)
47
 
# if defined ( MSVC )
48
 
#  define snprintf _vsnprintf
49
 
# endif
50
 
#endif /*HAVE_SNPRINTF*/
51
 
 
52
 
#ifdef MSVC
53
 
# include <io.h>
54
 
 
55
 
# ifndef S_ISBLK
56
 
#  define _S_IFBLK        0060000  /* Block Special */
57
 
#  define S_ISBLK(x) (x & _S_IFBLK)
58
 
# endif
59
 
 
60
 
# ifndef S_ISCHR
61
 
#  define       _S_IFCHR 0020000        /* character special */
62
 
#  define S_ISCHR(x) (x & _S_IFCHR)
63
 
# endif
64
 
#endif /*MSVC*/
65
 
 
66
 
#ifdef HAVE_MEMSET
67
 
# define BZERO(ptr, size) memset(ptr, 0, size)
68
 
#elif  HAVE_BZERO
69
 
# define BZERO(ptr, size) bzero(ptr, size)
70
 
#else 
71
 
  Error -- you need either memset or bzero
72
 
#endif
73
 
 
74
 
#endif /* __CDIO_PORTABLE_H__ */