mariadb/strings/strtoul.c
unknown 1275b4c513 If the system has 64 bit "long", then "long long" does not add new
functionality. The existing code takes advantage of this when
"typedef"ing 'longlong' in 'my_global.h'. This holds for Alpha CPUs.
If the compiler then has prototypes for C99 functions 'strtoll()' and
'strtoull()' but no implementation, the existing code in 'strtoull.c'
collides with that prototype. These collisions are avoided now.


include/m_string.h:
  Extend the "fake" approach from 'strtoull()' onto 'strtoll()'.
strings/strto.c:
  Ensure that calling file has included necessary headers,
  as these are needed at the upper level already.
strings/strtol.c:
  Cleanup/alignment with the "long long" functions.
strings/strtoll.c:
  When "long" is 64 bit already, system function 'strtol()' can be used.
  Header files 'my_global.h' and 'm_string.h' will manage that,
  if they are included early enough.
strings/strtoul.c:
  Cleanup/alignment with the "long long" functions.
strings/strtoull.c:
  When "long" is 64 bit already, system function 'strtoul()' can be used.
  Header files 'my_global.h' and 'm_string.h' will manage that,
  if they are included early enough.
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
2004-08-26 17:30:53 +02:00

30 lines
1.1 KiB
C

/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* This implements strtol() if needed */
/*
These includes are mandatory because they check for type sizes and
functions, especially they handle tricks for Tru64 where 'long' is
64 bit already and our 'longlong' is just a 'long'.
*/
#include <my_global.h>
#include <m_string.h>
#if !defined(MSDOS) && !defined(HAVE_STRTOUL)
#define USE_UNSIGNED
#include "strto.c"
#endif