More fixes for compilation with current SDCC compiler

This commit is contained in:
Gregory Nutt 2017-09-30 15:28:04 -06:00
parent 7acc98727b
commit ccabac3eb6
8 changed files with 43 additions and 9 deletions

View File

@ -88,7 +88,7 @@ Configuring NuttX
cd tools
./configure.sh z80sim/pashello
2) Set the PATH environment variable to include the path to the SDCC
toolchain.
toolchain binaries.
NOTES:
@ -171,9 +171,14 @@ compatible with this build. First start with the usual steps
cd sdcc
./configure
Note if you do not have the gputils packet installed, newer version of the
SDCC configure will fail. You will have to either install the gputils
package or if you don't need PIC14 or PIC16 support:
./configure --disable-pic14-port --disable-pic16-port
Then make the SDCC binaries
cd sdcc
make
and install SDCC:

View File

@ -40,9 +40,13 @@
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#ifdef CONFIG_HAVE_LONG_LONG
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@ -102,4 +106,5 @@ uint64_t crc64(FAR const uint8_t *src, size_t len);
}
#endif
#endif /* CONFIG_HAVE_LONG_LONG */
#endif /* __INCLUDE_CRC64_H */

View File

@ -40,6 +40,8 @@
// Included Files
//***************************************************************************
#include <nuttx/config.h>
#include <wchar.h>
#include <stdlib.h>
@ -112,10 +114,15 @@ namespace std
using ::wcsrtombs;
using ::wcsspn;
using ::wcsstr;
#ifdef CONFIG_HAVE_DOUBLE
using ::wcstod;
#endif
using ::wcstof;
using ::wcstok;
using ::wcstol;
#ifdef CONFIG_HAVE_LONG_DOUBLE
using ::wcstold;
#endif
using ::wcstoll;
using ::wcstoul;
using ::wcstoull;

View File

@ -1,7 +1,7 @@
/****************************************************************************
* include/wchar.h
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2014, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -218,11 +218,15 @@ size_t wcsrtombs(FAR char *, FAR const wchar_t **, size_t,
FAR mbstate_t *);
size_t wcsspn(FAR const wchar_t *, FAR const wchar_t *);
FAR wchar_t *wcsstr(FAR const wchar_t *, FAR const wchar_t *);
#ifdef CONFIG_HAVE_DOUBLE
double wcstod(FAR const wchar_t *, FAR wchar_t **);
#endif
float wcstof(FAR const wchar_t *, FAR wchar_t **);
FAR wchar_t *wcstok(FAR wchar_t *, FAR const wchar_t *, FAR wchar_t **);
long int wcstol(FAR const wchar_t *, FAR wchar_t **, int);
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double wcstold(FAR const wchar_t *, FAR wchar_t **);
#endif
long long int wcstoll(FAR const wchar_t *, FAR wchar_t **, int);
unsigned long int wcstoul(FAR const wchar_t *, FAR wchar_t **, int);
unsigned long long int wcstoull(FAR const wchar_t *, FAR wchar_t **, int);

View File

@ -40,11 +40,18 @@
#include <nuttx/config.h>
#include <stdbool.h>
#include <stdlib.h>
#include <inttypes.h>
#include <errno.h>
#include "libc.h"
/* Current implementation depends on strtoull() and, hence, is only
* available if long long types are supported.
*/
#ifdef CONFIG_HAVE_LONG_LONG
/****************************************************************************
* Public Functions
****************************************************************************/
@ -53,7 +60,7 @@
* Name: strtoimax
*
* Description:
* The strtoimax() function converts the initial part of the string in
* The strtoimax() function converts the initial part of the string in
* nptr to a intmax_t integer value according to the given base, which
* must be between 2 and 36 inclusive, or be the special value 0.
*
@ -118,3 +125,5 @@ intmax_t strtoimax(FAR const char *nptr, FAR char **endptr, int base)
return (intmax_t)accum;
}
#endif /* CONFIG_HAVE_LONG_LONG */

View File

@ -43,6 +43,8 @@
#include <stdint.h>
#include <crc64.h>
#ifdef CONFIG_HAVE_LONG_LONG
/****************************************************************************
* Private Data
****************************************************************************/
@ -299,3 +301,5 @@ uint64_t crc64(FAR const uint8_t *src, size_t len)
{
return crc64part(src, len, CRC64_INIT) ^ CRC64_XOROUT;
}
#endif /* CONFIG_HAVE_LONG_LONG */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* /libc/stdlib/lib_strtoul.c
*
* Copyright (C) 2007, 2009, 2011, 2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2007, 2009, 2011, 2016-2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -109,7 +109,7 @@ unsigned long strtoul(FAR const char *nptr, FAR char **endptr, int base)
if (endptr)
{
*endptr = (char *)nptr;
*endptr = (FAR char *)nptr;
}
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* libc/time/lib_difftime.c
*
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2016-2017 Gregory Nutt. All rights reserved.
* Author: Sebastien Lorquet <sebastien@lorquet.fr>
*
* Redistribution and use in source and binary forms, with or without
@ -72,7 +72,7 @@ float difftime(time_t time1, time_t time0)
* differences!)
*/
return (float)((uint32_t)(time1 - time0))
return (float)((uint32_t)(time1 - time0));
}
else
{
@ -80,7 +80,7 @@ float difftime(time_t time1, time_t time0)
* might not be set?
*/
return (float)((int32_t)(time1 - time0))
return (float)((int32_t)(time1 - time0));
}
}
#endif