From ce12e1d64d6b0b62609f061d3773a7e8b35849c3 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Tue, 30 Nov 2021 16:50:05 -0500 Subject: Auto flush for streams for stdin/out in slang-test (#2035) * #include an absolute path didn't work - because paths were taken to always be relative. * Move StreamType from Process to StdStreamType in slang-stream.h * Disable buffering for stdout/stderr for slang-test. * Improve comment. --- source/core/slang-process.h | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'source/core/slang-process.h') diff --git a/source/core/slang-process.h b/source/core/slang-process.h index 7cd7596ae..6d86d8b14 100644 --- a/source/core/slang-process.h +++ b/source/core/slang-process.h @@ -16,14 +16,6 @@ namespace Slang { class Process : public RefObject { public: - enum class StreamType - { - ErrorOut, - StdOut, - StdIn, - CountOf, - }; - typedef uint32_t Flags; struct Flag { @@ -34,7 +26,7 @@ public: }; /// Get the stream for the type - Stream* getStream(StreamType type) const { return m_streams[Index(type)]; } + Stream* getStream(StdStreamType type) const { return m_streams[Index(type)]; } /// Get the value returned from the process when it exited/returned. int32_t getReturnValue() const { return m_returnValue; } @@ -71,7 +63,7 @@ public: static void sleepCurrentThread(Int timeInMs); /// Get a standard stream - static SlangResult getStdStream(StreamType type, RefPtr& out); + static SlangResult getStdStream(StdStreamType type, RefPtr& out); /// Get the clock frequency static uint64_t getClockFrequency(); @@ -81,7 +73,7 @@ public: protected: int32_t m_returnValue = 0; ///< Value returned if process terminated - RefPtr m_streams[Index(StreamType::CountOf)]; ///< Streams to communicate with the process + RefPtr m_streams[Index(StdStreamType::CountOf)]; ///< Streams to communicate with the process }; } -- cgit v1.2.3