include/LibreOfficeKit/LibreOfficeKit.h     |    4 ++++
 include/LibreOfficeKit/LibreOfficeKitInit.h |    8 ++++++++
 2 files changed, 12 insertions(+)

New commits:
commit e53560d5dc667515be382a34c0e4e3ef5badd9a0
Author:     Patrick Luby <guibmac...@gmail.com>
AuthorDate: Fri Jan 10 19:09:50 2025 -0500
Commit:     Patrick Luby <guibomac...@gmail.com>
CommitDate: Mon Jan 20 14:12:52 2025 +0100

    Related: tdf#145127 force error when compiling for unsupported Apple OSs
    
    While LibreOfficeKit can be built on macOS, the built library won't work
    as intended since a headless vcl implementation is needed. Currently,
    iOS is the only Apple OS that has a headless vcl implementation so
    force a compiler error.
    
    Change-Id: Ib9318851ff7e6c98531672ba7241c22a91f3ef7c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180093
    Reviewed-by: Patrick Luby <guibomac...@gmail.com>
    Tested-by: Jenkins
    (cherry picked from commit 18e5d1ce26ab7a0fb41b8b64a0a732b5f81f3ed8)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180357
    Reviewed-by: Hossein   <hoss...@libreoffice.org>

diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index 757fb75821f7..a3d124592527 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -21,6 +21,10 @@
 # include <stdint.h>
 #endif
 
+#ifdef __APPLE__
+#include <TargetConditionals.h>
+#endif
+
 #include "LibreOfficeKitTypes.h"
 
 #ifdef __cplusplus
diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index eafee08083a4..38f893908619 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -34,6 +34,14 @@
     #ifdef __APPLE__
         #define TARGET_LIB        "lib" "sofficeapp" ".dylib"
         #define TARGET_MERGED_LIB "lib" "mergedlo" ".dylib"
+
+        #if !defined TARGET_OS_IPHONE || TARGET_OS_IPHONE == 0
+            #if defined TARGET_OS_OSX && TARGET_OS_OSX == 1
+                #error LibreOfficeKit is not supported on macOS
+            #else
+                #error LibreOfficeKit is not supported on tvOS, visionOS or 
watchOS
+            #endif
+        #endif
     #else
         #define TARGET_LIB        "lib" "sofficeapp" ".so"
         #define TARGET_MERGED_LIB "lib" "mergedlo" ".so"

Reply via email to