From cce3efd57a644a1fa1ee8fcb14b6b934d40c10d2 Mon Sep 17 00:00:00 2001 From: Owen Shepherd Date: Thu, 27 Dec 2012 00:27:28 +0000 Subject: [PATCH] Move existing errno handling to tss_errno, to allow the POSIX platform to just use the underlying OS's errno implementation. Eventually, tss_errno will use the thread specific primitives. --- {functions/_PDCLIB => opt/tss_errno}/errno.c | 8 +++++--- {includes => opt/tss_errno}/errno.h | 4 +--- platform/win32/Config.jam | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) rename {functions/_PDCLIB => opt/tss_errno}/errno.c (84%) rename {includes => opt/tss_errno}/errno.h (98%) diff --git a/functions/_PDCLIB/errno.c b/opt/tss_errno/errno.c similarity index 84% rename from functions/_PDCLIB/errno.c rename to opt/tss_errno/errno.c index 4facee5..6a606fc 100644 --- a/functions/_PDCLIB/errno.c +++ b/opt/tss_errno/errno.c @@ -7,11 +7,13 @@ */ #ifndef REGTEST -#include <_PDCLIB_int.h> +#include -int _PDCLIB_errno = 0; +/* Temporary */ -int * _PDCLIB_errno_func() +static int _PDCLIB_errno = 0; + +int * _PDCLIB_errno() { return &_PDCLIB_errno; } diff --git a/includes/errno.h b/opt/tss_errno/errno.h similarity index 98% rename from includes/errno.h rename to opt/tss_errno/errno.h index 34cf843..27eacb7 100644 --- a/includes/errno.h +++ b/opt/tss_errno/errno.h @@ -1,5 +1,3 @@ -/* $Id$ */ - /* 7.5 Errors This file is part of the Public Domain C Library (PDCLib). @@ -11,7 +9,7 @@ #include <_PDCLIB_int.h> _PDCLIB_BEGIN_EXTERN_C -#define errno (*_PDCLIB_errno_func()) +#define errno (*_PDCLIB_errno()) /* C99 */ #define ERANGE _PDCLIB_ERANGE diff --git a/platform/win32/Config.jam b/platform/win32/Config.jam index a078d6f..018ad61 100644 --- a/platform/win32/Config.jam +++ b/platform/win32/Config.jam @@ -23,6 +23,6 @@ if $(PDCLIB_TOOLCHAIN) = "gcc" { EXIT ; } -PDCLIB_OPTIONS = notime dlmalloc mincoll ; +PDCLIB_OPTIONS = notime dlmalloc mincoll tss_errno ; CRT0 = [ FDirName platform win32 crt0$(SUFOBJ) ] ; \ No newline at end of file -- 2.40.0