summaryrefslogtreecommitdiffstats
path: root/src/mesa/glapi/glapi.c
diff options
context:
space:
mode:
authorRandy Frank <[email protected]>2000-03-27 21:13:58 +0000
committerRandy Frank <[email protected]>2000-03-27 21:13:58 +0000
commitd7361e171738d92af6b4201d69faea0c55c2601c (patch)
tree0fb9699b04c24c6a3708c67264c0731e6a3a7d1a /src/mesa/glapi/glapi.c
parentba3d9d0ce958dfc6161de41d9423a4b9547fb35c (diff)
Updated to compile under Irix 6.5
Diffstat (limited to 'src/mesa/glapi/glapi.c')
-rw-r--r--src/mesa/glapi/glapi.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c
index 11cc56d559e..7d0ceb50924 100644
--- a/src/mesa/glapi/glapi.c
+++ b/src/mesa/glapi/glapi.c
@@ -1,4 +1,4 @@
-/* $Id: glapi.c,v 1.38 2000/03/19 01:10:11 brianp Exp $ */
+/* $Id: glapi.c,v 1.39 2000/03/27 21:13:58 rjfrank Exp $ */
/*
* Mesa 3-D graphics library
@@ -73,6 +73,17 @@ static _glthread_TSD ContextTSD;
static GLuint MaxDispatchOffset = sizeof(struct _glapi_table) / sizeof(void *) - 1;
static GLboolean GetSizeCalled = GL_FALSE;
+/* strdup is actually not a standard ANSI C or POSIX routine
+ Irix will not define it if ANSI mode is in effect. */
+static char *mesaStrdup(const char *str)
+{
+ char *copy;
+ copy = (char*) malloc(strlen(str) + 1);
+ if (!copy) return(NULL);
+ strcpy(copy,str);
+ return(copy);
+}
+
/*
@@ -1332,7 +1343,7 @@ _glapi_add_entrypoint(const char *funcName, GLuint offset)
if (!entrypoint)
return GL_FALSE;
- ExtEntryTable[NumExtEntryPoints].Name = strdup(funcName);
+ ExtEntryTable[NumExtEntryPoints].Name = mesaStrdup(funcName);
ExtEntryTable[NumExtEntryPoints].Offset = offset;
ExtEntryTable[NumExtEntryPoints].Address = entrypoint;
NumExtEntryPoints++;
@@ -1377,7 +1388,7 @@ _glapi_add_entrypoint2(const char *funcName)
entryPoint = generate_entrypoint(offset);
if (entryPoint) {
NextFreeOffset++;
- ExtEntryTable[NumExtEntryPoints].Name = strdup(funcName);
+ ExtEntryTable[NumExtEntryPoints].Name = mesaStrdup(funcName);
ExtEntryTable[NumExtEntryPoints].Offset = offset;
ExtEntryTable[NumExtEntryPoints].Address = entryPoint;
NumExtEntryPoints++;