mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
Check for defined types.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9956 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7aad1fd58a
commit
9896f623a1
4 changed files with 21 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
2001-05-14 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
* Headers/gnustep/base/objc-gnu2next.h: Add apply_t prototype.
|
||||
* Source/objc-gnu2next.m: Include stdio.h.
|
||||
* Source/GSFormat.m: Don't compare LONG_LONG_MAX if not defined
|
||||
|
||||
2001-05-15 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSString.m: ([stringByDeletingPathExtension]) rewrite to
|
||||
|
|
|
@ -37,6 +37,7 @@ typedef union {
|
|||
} *arglist_t; /* argument frame */
|
||||
//#define arglist_t marg_list
|
||||
#define retval_t void*
|
||||
typedef void(*apply_t)(void); /* function pointer */
|
||||
#define TypedStream void*
|
||||
|
||||
#define class_pointer isa
|
||||
|
|
|
@ -607,23 +607,29 @@ parse_one_spec (const unichar *format, size_t posn, struct printf_spec *spec,
|
|||
case 'Z':
|
||||
/* ints are size_ts. */
|
||||
assert (sizeof (size_t) <= sizeof (unsigned long long int));
|
||||
#if defined(LONG_LONG_MAX)
|
||||
#if LONG_MAX != LONG_LONG_MAX
|
||||
spec->info.is_long_double = sizeof (size_t) > sizeof (unsigned long int);
|
||||
#endif
|
||||
#endif
|
||||
spec->info.is_long = sizeof (size_t) > sizeof (unsigned int);
|
||||
break;
|
||||
case 't':
|
||||
assert (sizeof (ptrdiff_t) <= sizeof (long long int));
|
||||
#if defined(LONG_LONG_MAX)
|
||||
#if LONG_MAX != LONG_LONG_MAX
|
||||
spec->info.is_long_double = (sizeof (ptrdiff_t) > sizeof (long int));
|
||||
#endif
|
||||
#endif
|
||||
spec->info.is_long = sizeof (ptrdiff_t) > sizeof (int);
|
||||
break;
|
||||
case 'j':
|
||||
assert (sizeof (uintmax_t) <= sizeof (unsigned long long int));
|
||||
#if defined(LONG_LONG_MAX)
|
||||
#if LONG_MAX != LONG_LONG_MAX
|
||||
spec->info.is_long_double = (sizeof (uintmax_t)
|
||||
> sizeof (unsigned long int));
|
||||
#endif
|
||||
#endif
|
||||
spec->info.is_long = sizeof (uintmax_t) > sizeof (unsigned int);
|
||||
break;
|
||||
|
@ -647,10 +653,12 @@ parse_one_spec (const unichar *format, size_t posn, struct printf_spec *spec,
|
|||
case 'o':
|
||||
case 'X':
|
||||
case 'x':
|
||||
#if defined(LONG_LONG_MAX)
|
||||
#if LONG_MAX != LONG_LONG_MAX
|
||||
if (spec->info.is_long_double)
|
||||
spec->data_arg_type = PA_INT|PA_FLAG_LONG_LONG;
|
||||
else
|
||||
#endif
|
||||
#endif
|
||||
if (spec->info.is_long)
|
||||
spec->data_arg_type = PA_INT|PA_FLAG_LONG;
|
||||
|
@ -756,11 +764,15 @@ parse_one_spec (const unichar *format, size_t posn, struct printf_spec *spec,
|
|||
/* For handling long_double and longlong we use the same flag. If
|
||||
`long' and `long long' are effectively the same type define it to
|
||||
zero. */
|
||||
#if defined(LONG_LONG_MAX)
|
||||
#if LONG_MAX == LONG_LONG_MAX
|
||||
# define is_longlong 0
|
||||
#else
|
||||
# define is_longlong is_long_double
|
||||
#endif
|
||||
#else
|
||||
# define is_longlong 0
|
||||
#endif
|
||||
|
||||
/* If `long' and `int' is effectively the same type we don't have to
|
||||
handle `long separately. */
|
||||
|
|
|
@ -22,7 +22,8 @@
|
|||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "config.h"
|
||||
#include <stdio.h>
|
||||
#include <base/preface.h>
|
||||
|
||||
#ifndef ROUND
|
||||
|
|
Loading…
Reference in a new issue