* Add __attribute__((deprecated)) to functions whose interface using non ANSI data types
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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
diff --git a/ChangeLog b/ChangeLog
index 415bc8a..146d971 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
2007-02-05 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+ * include/freetype/ftmac.h (FT_DEPRECATED_ATTRIBUTE):
+ Introduce __attribute((deprecated))__ to warn functions
+ which use non ANSI data types in their interfaces.
+ (FT_GetFile_From_Mac_Name): Deprecated, using FSSpec.
+ (FT_GetFile_From_Mac_ATS_Name): Deprecated, using FSSpec.
+ (FT_New_Face_From_FSSpec): Deprecated, using FSSpec.
+ (FT_New_Face_From_FSRef): Deprecated, using FSRef.
+ * src/base/ftmac.c: predefine FT_DEPRECATED_ATTRIBUTE as blank
+ to avoid warning in building freetype.
+ * builds/mac/ftmac.c: Ditto.
+
+2007-02-05 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+
* src/base/ftbase.c: Fix to use builds/mac/ftmac.c, if configured
"--with-fsspec" etc. Replace #include "ftmac.c" by
#include <ftmac.c>.
diff --git a/builds/mac/ftmac.c b/builds/mac/ftmac.c
index 484784c..3b89a23 100644
--- a/builds/mac/ftmac.c
+++ b/builds/mac/ftmac.c
@@ -88,6 +88,8 @@
#include <FSp_fopen.h>
#endif
+#define FT_DEPRECATED_ATTRIBUTE
+
#include FT_MAC_H
#undef FT_GetFile_From_Mac_Name
diff --git a/include/freetype/ftmac.h b/include/freetype/ftmac.h
index 4529fe2..fc4f6bc 100644
--- a/include/freetype/ftmac.h
+++ b/include/freetype/ftmac.h
@@ -35,6 +35,16 @@
FT_BEGIN_HEADER
+/* gcc-3.4.1 and later can warn the functions attributed as deprecated */
+#ifndef FT_DEPRECATED_ATTRIBUTE
+#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
+#define FT_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
+#else
+#define FT_DEPRECATED_ATTRIBUTE
+#endif
+#endif
+
+
/*************************************************************************/
/* */
/* <Section> */
@@ -117,7 +127,8 @@ FT_BEGIN_HEADER
FT_EXPORT( FT_Error )
FT_GetFile_From_Mac_Name( const char* fontName,
FSSpec* pathSpec,
- FT_Long* face_index );
+ FT_Long* face_index )
+ FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/
@@ -144,7 +155,8 @@ FT_BEGIN_HEADER
FT_EXPORT( FT_Error )
FT_GetFile_From_Mac_ATS_Name( const char* fontName,
FSSpec* pathSpec,
- FT_Long* face_index );
+ FT_Long* face_index )
+ FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/
@@ -209,7 +221,8 @@ FT_BEGIN_HEADER
FT_New_Face_From_FSSpec( FT_Library library,
const FSSpec *spec,
FT_Long face_index,
- FT_Face *aface );
+ FT_Face *aface )
+ FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/
@@ -243,7 +256,8 @@ FT_BEGIN_HEADER
FT_New_Face_From_FSRef( FT_Library library,
const FSRef *ref,
FT_Long face_index,
- FT_Face *aface );
+ FT_Face *aface )
+ FT_DEPRECATED_ATTRIBUTE;
/* */
diff --git a/src/base/ftmac.c b/src/base/ftmac.c
index c8d06b0..82e05d4 100644
--- a/src/base/ftmac.c
+++ b/src/base/ftmac.c
@@ -82,6 +82,7 @@
#define HFS_MAXPATHLEN 1024
#endif
+#define FT_DEPRECATED_ATTRIBUTE
#include FT_MAC_H