~ubuntu-branches/ubuntu/oneiric/texinfo/oneiric

« back to all changes in this revision

Viewing changes to gnulib/lib/malloca.h

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Preining
  • Date: 2009-03-09 15:50:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090309155003-3k9a07mt2jqnuudg
Tags: 4.13a.dfsg.1-1
* new upstream releases (Closes: #500301)
  - fix (wrongly) added leading spaces in direntries (Closes: #457741)
  -  work with ~ in th epath (Closes: #495577)
  - disable the patch fix-direntry and fix-texi2dvi-bashism, 
    included upstream
* update the list of files to be installed (new translations, pdftexi2dvi)
* mange version in the watch file to remove the .dfsg.N part
* use quilt.make (first step in direction of source format 3.0, but that
  is broken)
* add README.Debian to info package (Closes: #513187)
* add README.source, bump standards version to 3.8.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
   This program is free software; you can redistribute it and/or modify
6
6
   it under the terms of the GNU General Public License as published by
7
 
   the Free Software Foundation; either version 2, or (at your option)
 
7
   the Free Software Foundation; either version 3, or (at your option)
8
8
   any later version.
9
9
 
10
10
   This program is distributed in the hope that it will be useful,
70
70
# define freea free
71
71
#endif
72
72
 
73
 
/* Maybe we should also define a variant
74
 
    nmalloca (size_t n, size_t s) - behaves like malloca (n * s)
75
 
   If this would be useful in your application. please speak up.  */
 
73
/* nmalloca(N,S) is an overflow-safe variant of malloca (N * S).
 
74
   It allocates an array of N objects, each with S bytes of memory,
 
75
   on the stack.  S must be positive and N must be nonnegative.
 
76
   The array must be freed using freea() before the function returns.  */
 
77
#if 1
 
78
/* Cf. the definition of xalloc_oversized.  */
 
79
# define nmalloca(n, s) \
 
80
    ((n) > (size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) \
 
81
     ? NULL \
 
82
     : malloca ((n) * (s)))
 
83
#else
 
84
extern void * nmalloca (size_t n, size_t s);
 
85
#endif
76
86
 
77
87
 
78
88
#ifdef __cplusplus