shithub: freetype+ttf2subf

Download patch

ref: 324612ceb24d97563a88415ebc84b3dcb3b935f0
parent: 939e844468f8af570e2eb028c1aad8a40df1699d
author: Werner Lemberg <[email protected]>
date: Sun Jan 31 09:28:44 EST 2021

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.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2021-01-31  Werner Lemberg  <[email protected]>
 
+	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  <[email protected]>
+
 	* builds/unix/configure.raw: Fix typo.
 
 	Bug introduced in Vincent's last commit bb33f03.
--- a/docs/DEBUG
+++ b/docs/DEBUG
@@ -260,7 +260,7 @@
 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.
 
--- a/include/freetype/ftlogging.h
+++ b/include/freetype/ftlogging.h
@@ -66,8 +66,8 @@
    *   ```
    *
    * @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 @@
    *
    *
    * @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 @@
    *     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 @@
    *   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 );
--- 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 */