From 3a15c6629047f66717ad771091305cf9752e5f41 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 29 Feb 2016 15:57:01 +0000 Subject: [PATCH] Merged improved parsing of #pragma from master. --- src/osg/Shader.cpp | 84 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 69 insertions(+), 15 deletions(-) diff --git a/src/osg/Shader.cpp b/src/osg/Shader.cpp index 794201f16..77e03e38c 100644 --- a/src/osg/Shader.cpp +++ b/src/osg/Shader.cpp @@ -33,8 +33,62 @@ #include #include -#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