Merge from default.

--HG--
branch : dtrg-videocore-branch-branch
This commit is contained in:
David Given
2016-03-13 21:13:09 +01:00
30 changed files with 328 additions and 167 deletions

View File

@@ -29,13 +29,13 @@ $g: $D/maketokentab $(OBJDIR)/$D/Lpars.h
$(eval $q: $(OBJDIR)/$D/Lpars.h)
$(eval $q: $(INCDIR)/print.h)
$(call file, $(LIBEM_MES))
$(call file, $(LIBEMK))
$(call file, $(LIBEM_DATA))
$(call file, $(LIBALLOC))
$(call file, $(LIBPRINT))
$(call file, $(LIBSTRING))
$(call file, $(LIBSYSTEM))
$(call rawfile, $(LIBEM_MES))
$(call rawfile, $(LIBEMK))
$(call rawfile, $(LIBEM_DATA))
$(call rawfile, $(LIBALLOC))
$(call rawfile, $(LIBPRINT))
$(call rawfile, $(LIBSTRING))
$(call rawfile, $(LIBSYSTEM))
$(call cprogram, $(BINDIR)/em_bem)
$(call installto, $(PLATDEP)/em_bem)

View File

@@ -134,16 +134,16 @@ $(call build-cemcom-ansi-next, \
$(eval $q: $(OBJDIR)/$D/Lpars.h)
$(call file, $(LIBEM_MES))
$(call file, $(LIBEMK))
$(call file, $(LIBEM_DATA))
$(call file, $(LIBINPUT))
$(call file, $(LIBASSERT))
$(call file, $(LIBALLOC))
$(call file, $(LIBFLT_ARITH))
$(call file, $(LIBPRINT))
$(call file, $(LIBSYSTEM))
$(call file, $(LIBSTRING))
$(call rawfile, $(LIBEM_MES))
$(call rawfile, $(LIBEMK))
$(call rawfile, $(LIBEM_DATA))
$(call rawfile, $(LIBINPUT))
$(call rawfile, $(LIBASSERT))
$(call rawfile, $(LIBALLOC))
$(call rawfile, $(LIBFLT_ARITH))
$(call rawfile, $(LIBPRINT))
$(call rawfile, $(LIBSYSTEM))
$(call rawfile, $(LIBSTRING))
$(call cprogram, $(BINDIR)/cemcom.ansi)
$(call installto, $(PLATDEP)/em_cemcom.ansi)
$(eval CEMCOMANSI := $o)

View File

@@ -71,12 +71,12 @@ define build-cpp-ansi-impl
$(call llgen, $(OBJDIR)/$D, $(OBJDIR)/$D/tokenfile.g $D/expression.g)
$(call file, $(LIBINPUT))
$(call file, $(LIBASSERT))
$(call file, $(LIBALLOC))
$(call file, $(LIBPRINT))
$(call file, $(LIBSYSTEM))
$(call file, $(LIBSTRING))
$(call rawfile, $(LIBINPUT))
$(call rawfile, $(LIBASSERT))
$(call rawfile, $(LIBALLOC))
$(call rawfile, $(LIBPRINT))
$(call rawfile, $(LIBSYSTEM))
$(call rawfile, $(LIBSTRING))
$(call tabgen, $D/char.tab)

View File

@@ -6,9 +6,61 @@
*/
/* $Id$ */
#ifndef _MALLOC_H
#define _MALLOC_H
#ifndef _STDLIB_H
#define _STDLIB_H
#include <stdlib.h>
#include <stddef.h>
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
#define RAND_MAX 32767
#define MB_CUR_MAX sizeof(wchar_t)
typedef struct { int quot, rem; } div_t;
typedef struct { long quot, rem; } ldiv_t;
extern double atof(const char *_nptr);
extern int atoi(const char *_nptr);
extern long atol(const char *_nptr);
extern double strtod(const char *_nptr, char **_endptr);
extern long strtol(const char *_nptr, char **_endptr, int _base);
extern unsigned long strtoul(const char *_nptr, char **_endptr, int _base);
extern int rand(void);
extern void srand(unsigned int _seed);
extern void* calloc(size_t _nmemb, size_t _size);
extern void free(void *_ptr);
extern void* malloc(size_t _size);
extern void* realloc(void *_ptr, size_t _size);
extern void abort(void);
extern int atexit(void (*_func)(void));
extern void exit(int _status);
extern void _Exit(int _status);
extern char* getenv(const char *_name);
extern int setenv(const char *_name, const char *_value, int _overwrite);
extern int unsetenv(const char *_name);
extern int putenv(char *_string);
extern int system(const char *_string);
extern void* bsearch(const void *_key, const void *_base,
size_t _nmemb, size_t _size,
int (*_compar)(const void *, const void *));
extern void qsort(void *_base, size_t _nmemb, size_t _size,
int (*_compar)(const void *, const void *));
extern int abs(int _j);
extern div_t div(int _numer, int _denom);
extern long labs(long _j);
extern ldiv_t ldiv(long _numer, long _denom);
extern int mblen(const char *_s, size_t _n);
extern int mbtowc(wchar_t *_pwc, const char *_s, size_t _n);
extern int wctomb(char *_s, wchar_t _wchar);
extern size_t mbstowcs(wchar_t *_pwcs, const char *_s, size_t _n);
extern size_t wcstombs(char *_s, const wchar_t *_pwcs, size_t _n);
/* Extensions (not part of the standard) */
#define atof(n) strtod(n, (char **)NULL)
#define atoi(n) ((int)strtol(n, (char **)NULL, 10))
#define atol(n) strtol(n, (char **)NULL, 10)
#define atoll(n) strtoll(n, (char **)NULL, 10)
#define mblen(s, n) mbtowc((wchar_t *)0, s, n)
#endif

View File

@@ -108,16 +108,16 @@ $(eval $q: $(INCDIR)/em_codeEK.h)
$(eval $q: $(INCDIR)/print.h)
$(eval $q: $(INCDIR)/system.h)
$(call file, $(LIBEM_MES))
$(call file, $(LIBEMK))
$(call file, $(LIBEM_DATA))
$(call file, $(LIBINPUT))
$(call file, $(LIBASSERT))
$(call file, $(LIBALLOC))
$(call file, $(LIBFLT_ARITH))
$(call file, $(LIBPRINT))
$(call file, $(LIBSYSTEM))
$(call file, $(LIBSTRING))
$(call rawfile, $(LIBEM_MES))
$(call rawfile, $(LIBEMK))
$(call rawfile, $(LIBEM_DATA))
$(call rawfile, $(LIBINPUT))
$(call rawfile, $(LIBASSERT))
$(call rawfile, $(LIBALLOC))
$(call rawfile, $(LIBFLT_ARITH))
$(call rawfile, $(LIBPRINT))
$(call rawfile, $(LIBSYSTEM))
$(call rawfile, $(LIBSTRING))
$(call cprogram, $(BINDIR)/em_m2)
$(call installto, $(PLATDEP)/em_m2)

View File

@@ -95,7 +95,7 @@ $(eval g := \
$(foreach f, $g, \
$(call reset) \
$(call file, lang/m2/libm2/$f) \
$(call rawfile, lang/m2/libm2/$f) \
$(call installto, $(PLATIND)/include/modula2/$f))
endef

View File

@@ -111,16 +111,16 @@ $(eval $q: $(INCDIR)/em_codeEK.h)
$(eval $q: $(INCDIR)/print.h)
$(eval $q: $(INCDIR)/system.h)
$(call file, $(LIBEM_MES))
$(call file, $(LIBEMK))
$(call file, $(LIBEM_DATA))
$(call file, $(LIBINPUT))
$(call file, $(LIBASSERT))
$(call file, $(LIBALLOC))
$(call file, $(LIBFLT_ARITH))
$(call file, $(LIBPRINT))
$(call file, $(LIBSYSTEM))
$(call file, $(LIBSTRING))
$(call rawfile, $(LIBEM_MES))
$(call rawfile, $(LIBEMK))
$(call rawfile, $(LIBEM_DATA))
$(call rawfile, $(LIBINPUT))
$(call rawfile, $(LIBASSERT))
$(call rawfile, $(LIBALLOC))
$(call rawfile, $(LIBFLT_ARITH))
$(call rawfile, $(LIBPRINT))
$(call rawfile, $(LIBSYSTEM))
$(call rawfile, $(LIBSTRING))
$(call cprogram, $(BINDIR)/em_pc)
$(call installto, $(PLATDEP)/em_pc)