Commit 47f00182346c97d0e5995c03bfcf3282243349ea

sammy 2008-04-25T12:22:22

* Use macros instead of enums in the C bindings. Not the most elegant thing, but it avoids naming conflicts when mixing C and C++ code. Patch by Eric Beets.

diff --git a/include/FTGL.h b/include/FTGL.h
index fb937c7..d857685 100644
--- a/include/FTGL.h
+++ b/include/FTGL.h
@@ -10,10 +10,10 @@
  * distribute, sublicense, and/or sell copies of the Software, and to
  * permit persons to whom the Software is furnished to do so, subject to
  * the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice shall be
  * included in all copies or substantial portions of the Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
@@ -42,8 +42,13 @@ namespace FTGL
     typedef enum{ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT, ALIGN_JUSTIFY} TextAlignment;
 }
 #else
-    typedef enum{RENDER_FRONT = 0x01, RENDER_BACK = 0x02, RENDER_SIDE = 0x04}ftglRenderMode;
-    typedef enum{ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT, ALIGN_JUSTIFY} TextAlignment;
+#   define FTGL_RENDER_FRONT  0x01
+#   define FTGL_RENDER_BACK   0x02
+#   define FTGL_RENDER_SIDE   0x04
+#   define FTGL_ALIGN_LEFT    0
+#   define FTGL_ALIGN_CENTER  1
+#   define FTGL_ALIGN_RIGHT   2
+#   define FTGL_ALIGN_JUSTIFY 3
 #endif
 
 typedef double   FTGL_DOUBLE;
diff --git a/include/FTSimpleLayout.h b/include/FTSimpleLayout.h
index f0a1d19..93dfde5 100644
--- a/include/FTSimpleLayout.h
+++ b/include/FTSimpleLayout.h
@@ -372,7 +372,7 @@ FTGL_EXPORT void                ftglLayoutSetAlignment   (FTGLlayout *, const FT
 FTGL_EXPORT FTGL::TextAlignment ftglLayoutGetAlignement  (FTGLlayout *);
 #else
 FTGL_EXPORT void                ftglLayoutSetAlignment   (FTGLlayout *, const TextAlignment);
-FTGL_EXPORT TextAlignment       ftglLayoutGetAlignement  (FTGLlayout *);
+FTGL_EXPORT int                 ftglLayoutGetAlignement  (FTGLlayout *);
 #endif
 
 FTGL_EXPORT void  ftglLayoutSetLineSpacing (FTGLlayout *, const float);