]> git.cworth.org Git - apitrace/blobdiff - helpers/glsize.hpp
gltrace: Handle negative lengths in glDebugMessageInsert* (issue 119).
[apitrace] / helpers / glsize.hpp
index 2da217f123a24ba3ce3058548f7886c9eb23640c..77ff8f09fdff65609e71c58a138f224f6a99aa09 100644 (file)
@@ -816,6 +816,18 @@ _glClearBuffer_size(GLenum buffer)
 }
 
 
+template<class T>
+static inline size_t
+_glStrLen(const T * string, GLsizei length)
+{
+    if (length >= 0) {
+        return length;
+    } else {
+        return strlen(string);
+    }
+}
+
+
 /**
  * Helper function for determining the string lengths for glShaderSource and
  * glShaderSourceARB, which is a tad too complex to inline in the specs.