* 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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
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);