From f73d1fb7eaa5784640383fdfeeca3fbf7f399744 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 29 Feb 2016 15:06:36 +0000 Subject: [PATCH] Refactored the parsing of #pragma to address problems handling #pragma without () usage. --- src/osg/Shader.cpp | 83 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 70 insertions(+), 13 deletions(-) diff --git a/src/osg/Shader.cpp b/src/osg/Shader.cpp index f77249487..270d17835 100644 --- a/src/osg/Shader.cpp +++ b/src/osg/Shader.cpp @@ -34,6 +34,63 @@ #include #include +namespace osg +{ + +template +inline std::string::size_type find_first(const std::string& str, const M& match, std::string::size_type startpos, std::string::size_type endpos=std::string::npos) +{ + std::string::size_type endp = (endpos!=std::string::npos) ? endpos : str.size(); + + while(startpos