Owen Shepherd [Mon, 13 Aug 2012 20:11:29 +0000 (21:11 +0100)]
* Test cleanups: surround the code for all functions by #ifndef REGTEST
* Don't REGTEST internal functions (it doesn't make sense)
* <stdio.h>: add _PDCLIB_fdopen, which opens a file based upon its _PDCLIB_fd_t
file descriptor
TODO: Should this be public or not? POSIX fdopen demonstrates utility
TODO: Can we stop storing the file name? Is that useful?
* fopen: rewrite based upon _PDCLIB_fdopen to consolidate code
* strndup: don't REGTEST - mingw doesn't implement.
* <stddef.h>: conditional definition of wchar_t for <wchar.h>
* <wchar.h>: Add 4 simple functions for dependencies
* <_PDCLIB_aux.h>: rename _PDCLIB_ALL to _PDCLIB_EXTENSIONS
* platform/example/functions/stdio/tmpfile.c: return NULL, not 1
* Build system: SubInclude the platform directory to enable the building of
support routines (e.g. app startup files)
* Test system: If $(CRT0) is set, link the contents of it into the tests. This
enables the platform code to provide startup files.
Owen Shepherd [Sun, 12 Aug 2012 18:47:31 +0000 (19:47 +0100)]
* New feature check macro system. See _PDCLIB_aux.h for details
* remove "#pragma weak" from strdup.c. It's nonportable and shouldn't be
necessary
* <string.h> changed to use new feature test system for strdup + strndup
* add strndup implementation
* <assert.h> more reliable handling of error messages
Build system:
* The CoreMake system is dead. It proved to be unscalable
* The old Make based system is gone, also
* We now use a Jam based system (requires the latest FT_Jam). Reasons:
* Make is hard to scale in a non-recursive manner. The interactions get
intractably complex
* The build system depended upon GNU Make. GNU Make's license (the GPLv3) is
about as diametrically opposed to PDCLib's CC0 as you can get without being
closed source
* Jam is actually more portable. In particular, it doesn't require a Unix
emulation layer (unlike GMake)
* The Jam system, as is, can be incorporated into the build system of a larger
project.
Why Jam?
* GNU make is too low level. It also incorporates too much magic: it can spend
significant ammounts of time trying to update source files from SCCS and RCS
files for example (a feature it is doubtful somebody has used in the last
decade)
* Systems like CMake are too high level: CMake is very difficult to use in a
cross compilation environment.
* Systems like Scons and Waf pose similar issues. Scons is also incredibly
slow.
Owen Shepherd [Sun, 5 Aug 2012 23:01:01 +0000 (00:01 +0100)]
* platform/example is now a "stub" platform - it should compile anywhere, but
be useful nowhere.
* The old platform/example code has been moved to platform/posix - it should
become a base implementation which works on any POSIX system
* A platform/win32 is probably due. This will be special in that it won't depend
upon the host OS' libc (instead depending directly upon kernel32)
Owen Shepherd [Fri, 3 Aug 2012 18:02:23 +0000 (19:02 +0100)]
Import dlmalloc (public domain) as a malloc implementation. Add stub opt/notime
implementation of time.h for platforms with no clock (which only implements the
time(time_t*) function) to support this.
(Note: Builds, but implementation as of yet untested)
Owen Shepherd [Thu, 2 Aug 2012 20:48:01 +0000 (21:48 +0100)]
* Change the style of inclusion of the internal/ headers. Modern preprocessors
all detect the header guards and know not to include anyhow. The old style may
have actually been counterproductive
* Make the built library be standard independent (i.e. the library build is
independent of _PDCLIB_C_VERSION/__STDC_VERSION__/_PDCLIB_CXX_VERSION
/__cplusplus.
* <threads.h> from C11. A bit off of the track of C99 support (which is still a
higher priority goal), but solid implementation of many C99 functions on many
real platforms will need proper thread support. <stdio.h> support to come.
This is a stub implementation.
* Move malloc/free/realloc etc to opt/malloc-solar, in preparation for support
of other memory allocators. On the cards are at least ptmalloc3 (BSD) and
dlmalloc (public domain) as options.
* New build system (See CoreMakefile.mk). Not ready yet; but its coming. This
doesn't change the project dependencies - you still only need GNU make.
This is a large bundle of changes - most of them are as a result of implementing
PDClib into my system, so they're mostly "changes I was doing" that have got
wrapped up together. Hopefully, now that things are together, future changesets
should be better factored.
Special thanks go to Martin "Solar" Baute for the work he has put in on this
code over many years.