Skip to content

Instantly share code, notes, and snippets.

@buserror
Created November 6, 2013 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buserror/7336713 to your computer and use it in GitHub Desktop.
Save buserror/7336713 to your computer and use it in GitHub Desktop.
quick compilation patch
From 3e76304ff29e91507aa275dfcdff77cab7109ae3 Mon Sep 17 00:00:00 2001
From: michel <michel@midesk.bsiuk.com>
Date: Wed, 6 Nov 2013 14:21:03 +0000
Subject: [PATCH] freetype-gl: fix on modern mesa
GL_TYPE is already taken, apparently
---
shared/libfreetype-gl/vertex-attribute.c | 20 ++++++++++----------
shared/libfreetype-gl/vertex-attribute.h | 26 +++++++++++++-------------
2 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/shared/libfreetype-gl/vertex-attribute.c b/shared/libfreetype-gl/vertex-attribute.c
index db089f0..8e2bb14 100644
--- a/shared/libfreetype-gl/vertex-attribute.c
+++ b/shared/libfreetype-gl/vertex-attribute.c
@@ -126,7 +126,7 @@ vertex_attribute_parse( char *format )
{
// Generic attribute
char *p = strpbrk ( format, "0123456789" );
- if (p == format)
+ if (p == format)
{
// Normalized
p = strpbrk ( format, "n" );
@@ -135,7 +135,7 @@ vertex_attribute_parse( char *format )
int size, index;
char ctype;
sscanf( format, "%dgn%d%c", &index, &size, &ctype );
- GLenum type = GL_TYPE( ctype );
+ GLenum type = _GL_TYPE( ctype );
return vertex_attribute_new( 0, index, size, type, GL_TRUE, 0, 0 );
}
else
@@ -143,11 +143,11 @@ vertex_attribute_parse( char *format )
int size, index;
char ctype;
sscanf( format, "%dg%d%c", &index, &size, &ctype );
- GLenum type = GL_TYPE( ctype );
+ GLenum type = _GL_TYPE( ctype );
return vertex_attribute_new( 0, index, size, type, GL_FALSE, 0, 0 );
}
}
-
+
// Known attribute
p = strpbrk ( format, "vcntfse" );
if ( p != 0 )
@@ -155,7 +155,7 @@ vertex_attribute_parse( char *format )
int size;
char ctarget, ctype;
sscanf( format, "%c%d%c", &ctarget, &size, &ctype );
- GLenum type = GL_TYPE( ctype );
+ GLenum type = _GL_TYPE( ctype );
GLenum target = GL_VERTEX_ATTRIBUTE_TARGET( ctarget );
return vertex_attribute_new( target, 0, size, type, GL_FALSE, 0, 0 );
}
@@ -213,7 +213,7 @@ vertex_attribute_new( GLenum target,
attribute->enable =
(void(*)(void *)) vertex_attribute_normal_enable;
break;
-
+
case GL_COLOR_ARRAY:
attribute->ctarget = 'c';
assert( (size == 3) || (size == 4) );
@@ -224,7 +224,7 @@ vertex_attribute_new( GLenum target,
attribute->enable =
(void(*)(void *)) vertex_attribute_color_enable;
break;
-
+
case GL_TEXTURE_COORD_ARRAY:
attribute->ctarget = 't';
assert( (type == GL_SHORT) || (type == GL_INT) ||
@@ -240,7 +240,7 @@ vertex_attribute_new( GLenum target,
attribute->enable =
(void(*)(void *)) vertex_attribute_fog_coord_enable;
break;
-
+
case GL_EDGE_FLAG_ARRAY:
attribute->ctarget = 'e';
assert( size == 1 );
@@ -291,7 +291,7 @@ vertex_attribute_delete( vertex_attribute_t * self )
// ----------------------------------------------------------------------------
GLenum
-GL_TYPE( char ctype )
+_GL_TYPE( char ctype )
{
switch( ctype )
{
@@ -331,7 +331,7 @@ GL_VERTEX_ATTRIBUTE_TARGET( char ctarget )
// ----------------------------------------------------------------------------
-GLuint
+GLuint
GL_TYPE_SIZE( GLenum gtype )
{
switch( gtype )
diff --git a/shared/libfreetype-gl/vertex-attribute.h b/shared/libfreetype-gl/vertex-attribute.h
index bbf8610..75ab303 100644
--- a/shared/libfreetype-gl/vertex-attribute.h
+++ b/shared/libfreetype-gl/vertex-attribute.h
@@ -102,7 +102,7 @@ extern "C" {
* </tr>
* <tr>
* <td> Generic attribute </td>
- * <td> "[0-15]g(n)?[1234][bBsSiIfd]" </td>
+ * <td> "[0-15]g(n)?[1234][bBsSiIfd]" </td>
* <td> </td>
* </tr>
* </table>
@@ -112,47 +112,47 @@ extern "C" {
* <table>
* <tr>
* <th> Format </th>
- * <th> Type </th>
+ * <th> Type </th>
* <th> GL Type </th>
* </tr>
* <tr>
* <td> "b" </td>
- * <td> Signed byte </td>
+ * <td> Signed byte </td>
* <td> GL_BYTE </td>
* </tr>
* <tr>
* <td> "B" </td>
- * <td> Unsigned byte </td>
+ * <td> Unsigned byte </td>
* <td> GL_UNSIGNED_BYTE </td>
* </tr>
* <tr>
* <td> "s" </td>
- * <td> Signed short </td>
+ * <td> Signed short </td>
* <td> GL_SHORT </td>
* </tr>
* <tr>
* <td> "S" </td>
- * <td> Unsigned short </td>
+ * <td> Unsigned short </td>
* <td> GL_UNSIGNED_SHORT </td>
* </tr>
* <tr>
* <td> "i" </td>
- * <td> Signed int </td>
+ * <td> Signed int </td>
* <td> GL_INT </td>
* </tr>
* <tr>
* <td> "I" </td>
- * <td> Unsigned int </td>
+ * <td> Unsigned int </td>
* <td> GL_UNSIGNED_INT </td>
* </tr>
* <tr>
* <td> "f" </td>
- * <td> Float </td>
+ * <td> Float </td>
* <td> GL_FLOAT </td>
* </tr>
* <tr>
* <td> "d" </td>
- * <td> Double </td>
+ * <td> Double </td>
* <td> GL_DOUBLE T </td>
* </tr>
* </table>
@@ -196,7 +196,7 @@ extern "C" {
/**
* Generic vertex attribute.
*/
-typedef struct
+typedef struct
{
/**
* a client-side capability.
@@ -220,7 +220,7 @@ typedef struct
*/
GLint size;
- /**
+ /**
* data type of each component in the array.
*
* Symbolic constants GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT,
@@ -406,7 +406,7 @@ vertex_attribute_delete( vertex_attribute_t * self );
* @private
*/
GLenum
- GL_TYPE( char ctype );
+ _GL_TYPE( char ctype );
/**
--
1.8.4.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment