~hamo/ubuntu/precise/grub2/grub2.hi_res

« back to all changes in this revision

Viewing changes to grub-core/gnulib/stdbool.in.h

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson, Colin Watson, Evan Broder, Mario Limonciello
  • Date: 2010-11-24 13:59:55 UTC
  • mfrom: (1.17.6 upstream) (17.6.15 experimental)
  • Revision ID: james.westby@ubuntu.com-20101124135955-r6ii5sepayr7jt53
Tags: 1.99~20101124-1ubuntu1
[ Colin Watson ]
* Resynchronise with Debian experimental.  Remaining changes:
  - Adjust for default Ubuntu boot options ("quiet splash").
  - Default to hiding the menu; holding down Shift at boot will show it.
  - Set a monochromatic theme for Ubuntu.
  - Apply Ubuntu GRUB Legacy changes to legacy update-grub script: title,
    recovery mode, quiet option, tweak how memtest86+ is displayed, and
    use UUIDs where appropriate.
  - Fix backslash-escaping in merge_debconf_into_conf.
  - Remove "GNU/Linux" from default distributor string.
  - Add crashkernel= options if kdump and makedumpfile are available.
  - If other operating systems are installed, then automatically unhide
    the menu.  Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus
    if available to check whether Shift is pressed.  If it is, show the
    menu, otherwise boot immediately.  If keystatus is not available, then
    fall back to a short delay interruptible with Escape.
  - Allow Shift to interrupt 'sleep --interruptible'.
  - Don't display introductory message about line editing unless we're
    actually offering a shell prompt.  Don't clear the screen just before
    booting if we never drew the menu in the first place.
  - Remove some verbose messages printed before reading the configuration
    file.
  - Suppress progress messages as the kernel and initrd load for
    non-recovery kernel menu entries.
  - Change prepare_grub_to_access_device to handle filesystems
    loop-mounted on file images.
  - Ignore devices loop-mounted from files in 10_linux.
  - Show the boot menu if the previous boot failed, that is if it failed
    to get to the end of one of the normal runlevels.
  - Don't generate /boot/grub/device.map during grub-install or
    grub-mkconfig by default.
  - Adjust upgrade version checks for Ubuntu.
  - Don't display "GRUB loading" unless Shift is held down.
  - Adjust versions of grub-doc and grub-legacy-doc conflicts to tolerate
    our backport of the grub-doc split.
  - Fix LVM/RAID probing in the absence of /boot/grub/device.map.
  - Look for .mo files in /usr/share/locale-langpack as well, in
    preference.
  - Make sure GRUB_TIMEOUT isn't quoted unnecessarily.
  - Probe all devices in 'grub-probe --target=drive' if
    /boot/grub/device.map is missing.
  - Build-depend on qemu-kvm rather than qemu-system for grub-pc tests.
  - Use qemu rather than qemu-system-i386.
  - Program vesafb on BIOS systems rather than efifb.
  - Add a grub-rescue-efi-amd64 package containing a rescue CD-ROM image
    for EFI-AMD64.
  - On Wubi, don't ask for an install device, but just update wubildr
    using the diverted grub-install.
  - When embedding the core image in a post-MBR gap, check for and avoid
    sectors matching any of a list of known signatures.
  - Disable video_bochs and video_cirrus on PC BIOS systems, as probing
    PCI space seems to break on some systems.
* Downgrade "ACPI shutdown failed" error to a debug message, since it can
  cause spurious test failures.

[ Evan Broder ]
* Enable lua from grub-extras.
* Incorporate the bitop library into lua.
* Add enum_pci function to grub module in lua.
* Switch back to gfxpayload=keep by default, unless the video hardware
  is known to not support it.

[ Mario Limonciello ]
* Built part_msdos and vfat into bootx64.efi (LP: #677758)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2001-2003, 2006-2010 Free Software Foundation, Inc.
 
2
   Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
3
 
 
4
   This program is free software; you can redistribute it and/or modify
 
5
   it under the terms of the GNU General Public License as published by
 
6
   the Free Software Foundation; either version 3, or (at your option)
 
7
   any later version.
 
8
 
 
9
   This program is distributed in the hope that it will be useful,
 
10
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
   GNU General Public License for more details.
 
13
 
 
14
   You should have received a copy of the GNU General Public License
 
15
   along with this program; if not, write to the Free Software Foundation,
 
16
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
17
 
 
18
#ifndef _GL_STDBOOL_H
 
19
#define _GL_STDBOOL_H
 
20
 
 
21
/* ISO C 99 <stdbool.h> for platforms that lack it.  */
 
22
 
 
23
/* Usage suggestions:
 
24
 
 
25
   Programs that use <stdbool.h> should be aware of some limitations
 
26
   and standards compliance issues.
 
27
 
 
28
   Standards compliance:
 
29
 
 
30
       - <stdbool.h> must be #included before 'bool', 'false', 'true'
 
31
         can be used.
 
32
 
 
33
       - You cannot assume that sizeof (bool) == 1.
 
34
 
 
35
       - Programs should not undefine the macros bool, true, and false,
 
36
         as C99 lists that as an "obsolescent feature".
 
37
 
 
38
   Limitations of this substitute, when used in a C89 environment:
 
39
 
 
40
       - <stdbool.h> must be #included before the '_Bool' type can be used.
 
41
 
 
42
       - You cannot assume that _Bool is a typedef; it might be a macro.
 
43
 
 
44
       - Bit-fields of type 'bool' are not supported.  Portable code
 
45
         should use 'unsigned int foo : 1;' rather than 'bool foo : 1;'.
 
46
 
 
47
       - In C99, casts and automatic conversions to '_Bool' or 'bool' are
 
48
         performed in such a way that every nonzero value gets converted
 
49
         to 'true', and zero gets converted to 'false'.  This doesn't work
 
50
         with this substitute.  With this substitute, only the values 0 and 1
 
51
         give the expected result when converted to _Bool' or 'bool'.
 
52
 
 
53
       - C99 allows the use of (_Bool)0.0 in constant expressions, but
 
54
         this substitute cannot always provide this property.
 
55
 
 
56
   Also, it is suggested that programs use 'bool' rather than '_Bool';
 
57
   this isn't required, but 'bool' is more common.  */
 
58
 
 
59
 
 
60
/* 7.16. Boolean type and values */
 
61
 
 
62
/* BeOS <sys/socket.h> already #defines false 0, true 1.  We use the same
 
63
   definitions below, but temporarily we have to #undef them.  */
 
64
#if defined __BEOS__ && !defined __HAIKU__
 
65
# include <OS.h> /* defines bool but not _Bool */
 
66
# undef false
 
67
# undef true
 
68
#endif
 
69
 
 
70
/* For the sake of symbolic names in gdb, we define true and false as
 
71
   enum constants, not only as macros.
 
72
   It is tempting to write
 
73
      typedef enum { false = 0, true = 1 } _Bool;
 
74
   so that gdb prints values of type 'bool' symbolically. But if we do
 
75
   this, values of type '_Bool' may promote to 'int' or 'unsigned int'
 
76
   (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
 
77
   (see ISO C 99 6.3.1.1.(2)).  So we add a negative value to the
 
78
   enum; this ensures that '_Bool' promotes to 'int'.  */
 
79
#if defined __cplusplus || (defined __BEOS__ && !defined __HAIKU__)
 
80
  /* A compiler known to have 'bool'.  */
 
81
  /* If the compiler already has both 'bool' and '_Bool', we can assume they
 
82
     are the same types.  */
 
83
# if !@HAVE__BOOL@
 
84
typedef bool _Bool;
 
85
# endif
 
86
#else
 
87
# if !defined __GNUC__
 
88
   /* If @HAVE__BOOL@:
 
89
        Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
 
90
        the built-in _Bool type is used.  See
 
91
          http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
 
92
          http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
 
93
          http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
 
94
        Similar bugs are likely with other compilers as well; this file
 
95
        wouldn't be used if <stdbool.h> was working.
 
96
        So we override the _Bool type.
 
97
      If !@HAVE__BOOL@:
 
98
        Need to define _Bool ourselves. As 'signed char' or as an enum type?
 
99
        Use of a typedef, with SunPRO C, leads to a stupid
 
100
          "warning: _Bool is a keyword in ISO C99".
 
101
        Use of an enum type, with IRIX cc, leads to a stupid
 
102
          "warning(1185): enumerated type mixed with another type".
 
103
        Even the existence of an enum type, without a typedef,
 
104
          "Invalid enumerator. (badenum)" with HP-UX cc on Tru64.
 
105
        The only benefit of the enum, debuggability, is not important
 
106
        with these compilers.  So use 'signed char' and no enum.  */
 
107
#  define _Bool signed char
 
108
# else
 
109
   /* With this compiler, trust the _Bool type if the compiler has it.  */
 
110
#  if !@HAVE__BOOL@
 
111
typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
 
112
#  endif
 
113
# endif
 
114
#endif
 
115
#define bool _Bool
 
116
 
 
117
/* The other macros must be usable in preprocessor directives.  */
 
118
#define false 0
 
119
#define true 1
 
120
#define __bool_true_false_are_defined 1
 
121
 
 
122
#endif /* _GL_STDBOOL_H */