From 77fe3dd74446fb07dd0de31114f7033f111ef868 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 15 Aug 2019 18:38:59 -0400 Subject: A more convoluted #pragma once file identity test, using relative paths. (#1021) * A more convoluted #pragma once file identity test, using relative paths. * Fix bug with passing - to slang as a command line option causes a crash. Ability to set file-system to use on command line. #pragma once tests try with 'normal' and 'read-file' only versions * OSFileSystem -> OSFileSystemExt LoadFileOSFileSystem -> OSFileSystem Implemented OSFileSystem like OSFileSystemExt as as singleton. Fixes to comments. --- source/slang/slang.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/slang/slang.cpp') diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index f0570132f..eef0dff6f 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -2365,17 +2365,17 @@ void Linkage::setFileSystem(ISlangFileSystem* inFileSystem) // Set the fileSystem fileSystem = inFileSystem; - // Set up fileSystemExt appropriately + // If nullptr passed in set up default if (inFileSystem == nullptr) { - fileSystemExt = new Slang::CacheFileSystem(Slang::OSFileSystem::getSingleton()); + fileSystemExt = new Slang::CacheFileSystem(Slang::OSFileSystemExt::getSingleton()); } else { - // See if we have the interface + // See if we have the full ISlangFileSystemExt interface, if we do just use it inFileSystem->queryInterface(IID_ISlangFileSystemExt, (void**)fileSystemExt.writeRef()); - // If not wrap with WrapFileSytem that keeps the old behavior + // If not wrap with CacheFileSystem that emulates ISlangFileSystemExt from the ISlangFileSystem interface if (!fileSystemExt) { // Construct a wrapper to emulate the extended interface behavior -- cgit v1.2.3