From 0a3ef7b4ae02983ea3f986ba8211e7c6af9d254b Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 21 Jan 2019 15:33:59 -0500 Subject: Path simplification/hash mode, plus bug fixes (#788) * * Fix memory bug around expanding va_args - needed buffer to have space for terminating 0 * Fix problem with FileWriter defaults being globals, as memory they allocate, will only be freed after return from main - work around by making StdWriters RefObject derived, and kept in scope such the writers are destroyed before checks for leaks is found * Added SimplifyPathAndHash mode for CacheFileSystem - will simplify the path and see if simplified path is in cache before reading file (limiting amout of underlying file requests) * * Added calcReplaceChar * Renamed DefaultFileSystem to OSFileSystem * Made OSFileSystem convert windows \ to / on linux * Simplified logic for caching in CacheFileSystem. * Added pragma-once-c to add extra test, but also so there is an 'include' directory in preprocessor tests. * Small fixes in pragma once test. * Simplified cache handling path, so that paths/simplified paths area always added. * Improve naming of methods for different caches. --- tests/preprocessor/include/pragma-once-c.h | 7 +++++++ tests/preprocessor/pragma-once.slang | 12 ++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 tests/preprocessor/include/pragma-once-c.h (limited to 'tests/preprocessor') diff --git a/tests/preprocessor/include/pragma-once-c.h b/tests/preprocessor/include/pragma-once-c.h new file mode 100644 index 000000000..c44e2e46c --- /dev/null +++ b/tests/preprocessor/include/pragma-once-c.h @@ -0,0 +1,7 @@ +// pragma-once-c.h + +// Used by the `pragma-once.slang` test + +#pragma once + +#define ONLY_DEFINED_ONCE_C \ No newline at end of file diff --git a/tests/preprocessor/pragma-once.slang b/tests/preprocessor/pragma-once.slang index 02db6e3b3..43ddee680 100644 --- a/tests/preprocessor/pragma-once.slang +++ b/tests/preprocessor/pragma-once.slang @@ -31,6 +31,18 @@ #include "./pragma-once-a.h" #include "./pragma-once-a.h" +#include ".\pragma-once-a.h" +#include "./include\../pragma-once-a.h" + +#include "../preprocessor/./pragma-once-a.h" + +#include "include/pragma-once-c.h" +#include "./include\pragma-once-c.h" + +#ifndef ONLY_DEFINED_ONCE_C +#undef BAR +#endif + // Now let's use both the function and the // macro, to confirm that they are both // defined as expected. -- cgit v1.2.3