summaryrefslogtreecommitdiff
path: root/progs
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-05-31 20:36:52 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-05-31 20:36:52 +0000
commit1ec9b5a5a9fefc152062ea817fda9e6fa13bae21 (patch)
tree3a54acd195e74061cd6a496d5920c8644f4e5de6 /progs
parente689a7fc6a743e15b1534732c8973119a39dd928 (diff)
fix extension_supported() function, added comments
Diffstat (limited to 'progs')
-rw-r--r--progs/tests/getprocaddress.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/progs/tests/getprocaddress.c b/progs/tests/getprocaddress.c
index 2480ed44cc7..8cca200f215 100644
--- a/progs/tests/getprocaddress.c
+++ b/progs/tests/getprocaddress.c
@@ -39,6 +39,14 @@ typedef void (*generic_func)();
#define EQUAL(X, Y) (fabs((X) - (Y)) < 0.001)
+/**
+ * The following functions are used to check that the named OpenGL function
+ * actually does what it's supposed to do.
+ * The naming of these functions is signficant. The getprocaddress.py script
+ * scans this file and extracts these function names.
+ */
+
+
static GLboolean
test_ActiveTextureARB(generic_func func)
{
@@ -261,8 +269,7 @@ test_VertexAttrib4dvNV(generic_func func)
/*
- * The following header file is auto-generated with Python. The Python
- * script looks in this file for functions named "test_*" as seen above.
+ * The following file is auto-generated with Python.
*/
#include "getproclist.h"
@@ -271,8 +278,15 @@ test_VertexAttrib4dvNV(generic_func func)
static int
extension_supported(const char *haystack, const char *needle)
{
- if (strstr(haystack, needle))
- return 1;
+ const char *p = strstr(haystack, needle);
+ if (p) {
+ /* found string, make sure next char is space or zero */
+ const int len = strlen(needle);
+ if (p[len] == ' ' || p[len] == 0)
+ return 1;
+ else
+ return 0;
+ }
else
return 0;
}