Always provide logging API. It's easier to have stubs if FT_DEBUG_LOGGING is undefined than to modify `ftexport.sym` conditionally. Problem reported by Alexei. * src/base/ftdebug.c: Include `ftlogging.h`. (FT_Trace_Set_Level, FT_Trace_Set_Default_Level, FT_Set_Log_Handler, FT_Set_Default_Log_Handler) [!FT_DEBUG_LOGGING]: Provide stubs.
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 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
diff --git a/ChangeLog b/ChangeLog
index 171e73a..119e71d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
2021-01-31 Werner Lemberg <wl@gnu.org>
+ Always provide logging API.
+
+ It's easier to have stubs if FT_DEBUG_LOGGING is undefined than to
+ modify `ftexport.sym` conditionally.
+
+ Problem reported by Alexei.
+
+ * src/base/ftdebug.c: Include `ftlogging.h`.
+
+ (FT_Trace_Set_Level, FT_Trace_Set_Default_Level, FT_Set_Log_Handler,
+ FT_Set_Default_Log_Handler) [!FT_DEBUG_LOGGING]: Provide stubs.
+
+2021-01-31 Werner Lemberg <wl@gnu.org>
+
* builds/unix/configure.raw: Fix typo.
Bug introduced in Vincent's last commit bb33f03.
diff --git a/docs/DEBUG b/docs/DEBUG
index 0e24df6..9a5fdc6 100644
--- a/docs/DEBUG
+++ b/docs/DEBUG
@@ -260,7 +260,7 @@ IV. Additional Capabilities with `FT_DEBUG_LOGGING'
If `FT_DEBUG_LOGGING' is defined, four APIs are available to provide
additional debugging support. Use
- #include<freetype/ftlogging.h>
+ #include <freetype/ftlogging.h>
to access them.
diff --git a/include/freetype/ftlogging.h b/include/freetype/ftlogging.h
index 5c819ac..8811261 100644
--- a/include/freetype/ftlogging.h
+++ b/include/freetype/ftlogging.h
@@ -66,8 +66,8 @@ FT_BEGIN_HEADER
* ```
*
* @note:
- * This function is only available if compilation option
- * `FT_DEBUG_LOGGING` is set.
+ * This function does nothing if compilation option `FT_DEBUG_LOGGING`
+ * isn't set.
*/
FT_EXPORT( void )
FT_Trace_Set_Level( const char* tracing_level );
@@ -85,8 +85,8 @@ FT_BEGIN_HEADER
*
*
* @note:
- * This function is only available if compilation option
- * `FT_DEBUG_LOGGING` is set.
+ * This function does nothing if compilation option `FT_DEBUG_LOGGING`
+ * isn't set.
*/
FT_EXPORT( void )
FT_Trace_Set_Default_Level( void );
@@ -131,8 +131,8 @@ FT_BEGIN_HEADER
* New logging function.
*
* @note:
- * This function is only available if compilation option
- * `FT_DEBUG_LOGGING` is set.
+ * This function does nothing if compilation option `FT_DEBUG_LOGGING`
+ * isn't set.
*/
FT_EXPORT( void )
FT_Set_Log_Handler( FT_Custom_Log_Handler handler );
@@ -148,8 +148,8 @@ FT_BEGIN_HEADER
* log handler to FreeType's built-in version.
*
* @note:
- * This function is only available if compilation option
- * `FT_DEBUG_LOGGING` is set.
+ * This function does nothing if compilation option `FT_DEBUG_LOGGING`
+ * isn't set.
*/
FT_EXPORT( void )
FT_Set_Default_Log_Handler( void );
diff --git a/src/base/ftdebug.c b/src/base/ftdebug.c
index b0fbd9e..bf40186 100644
--- a/src/base/ftdebug.c
+++ b/src/base/ftdebug.c
@@ -42,6 +42,7 @@
#include <freetype/freetype.h>
+#include <freetype/ftlogging.h>
#include <freetype/internal/ftdebug.h>
#include <freetype/internal/ftobjs.h>
@@ -589,7 +590,7 @@
/* documentation is in ftlogging.h */
FT_EXPORT_DEF( void )
- FT_Set_Default_Log_Handler()
+ FT_Set_Default_Log_Handler( void )
{
custom_output_handler = NULL;
}
@@ -608,7 +609,36 @@
va_end( ap );
}
-#endif /* FT_DEBUG_LOGGING */
+#else /* !FT_DEBUG_LOGGING */
+
+ FT_EXPORT_DEF( void )
+ FT_Trace_Set_Level( const char* level )
+ {
+ FT_UNUSED( level );
+ }
+
+
+ FT_EXPORT_DEF( void )
+ FT_Trace_Set_Default_Level( void )
+ {
+ /* nothing */
+ }
+
+
+ FT_EXPORT_DEF( void )
+ FT_Set_Log_Handler( FT_Custom_Log_Handler handler )
+ {
+ FT_UNUSED( handler );
+ }
+
+
+ FT_EXPORT_DEF( void )
+ FT_Set_Default_Log_Handler( void )
+ {
+ /* nothing */
+ }
+
+#endif /* !FT_DEBUG_LOGGING */
/* END */