Title: [285811] trunk/Source/WebCore/PAL
Revision
285811
Author
[email protected]
Date
2021-11-15 10:36:47 -0800 (Mon, 15 Nov 2021)

Log Message

Declare NSTextListMarker* as type NSTextListMarkerFormat when soft-linking
https://bugs.webkit.org/show_bug.cgi?id=233064
rdar://85341122

Reviewed by Tim Horton.

Followup to r285744. Avoid build errors due to defining these constants as a different type of symbol
(NSString * vs. NSTextListMarkerFormat). To address this, we directly import `NSTextList.h` if it's available in
the SDK; otherwise, fall back to defining NSTextListMarkerFormat. In both cases, we need to keep soft linking
each of these constants, since WebCore cannot explicitly link against UIKit.

* pal/spi/cocoa/NSAttributedStringSPI.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/PAL/ChangeLog (285810 => 285811)


--- trunk/Source/WebCore/PAL/ChangeLog	2021-11-15 18:36:44 UTC (rev 285810)
+++ trunk/Source/WebCore/PAL/ChangeLog	2021-11-15 18:36:47 UTC (rev 285811)
@@ -1,3 +1,18 @@
+2021-11-15  Wenson Hsieh  <[email protected]>
+
+        Declare NSTextListMarker* as type NSTextListMarkerFormat when soft-linking
+        https://bugs.webkit.org/show_bug.cgi?id=233064
+        rdar://85341122
+
+        Reviewed by Tim Horton.
+
+        Followup to r285744. Avoid build errors due to defining these constants as a different type of symbol
+        (NSString * vs. NSTextListMarkerFormat). To address this, we directly import `NSTextList.h` if it's available in
+        the SDK; otherwise, fall back to defining NSTextListMarkerFormat. In both cases, we need to keep soft linking
+        each of these constants, since WebCore cannot explicitly link against UIKit.
+
+        * pal/spi/cocoa/NSAttributedStringSPI.h:
+
 2021-11-14  Myles C. Maxfield  <[email protected]>
 
         [WebGPU] Various mechanical cleanups

Modified: trunk/Source/WebCore/PAL/pal/spi/cocoa/NSAttributedStringSPI.h (285810 => 285811)


--- trunk/Source/WebCore/PAL/pal/spi/cocoa/NSAttributedStringSPI.h	2021-11-15 18:36:44 UTC (rev 285810)
+++ trunk/Source/WebCore/PAL/pal/spi/cocoa/NSAttributedStringSPI.h	2021-11-15 18:36:47 UTC (rev 285811)
@@ -95,31 +95,37 @@
 #define NSMarkedClauseSegmentAttributeName getNSMarkedClauseSegmentAttributeName()
 SOFT_LINK_CONSTANT(UIFoundation, NSTextAlternativesAttributeName, NSString *)
 #define NSTextAlternativesAttributeName getNSTextAlternativesAttributeName()
-SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerCircle, NSString *)
+
+#if __has_include(<UIKit/NSTextList.h>)
+#import <UIKit/NSTextList.h>
+#else
+typedef NSString *NSTextListMarkerFormat;
+#endif
+SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerCircle, NSTextListMarkerFormat)
 #define NSTextListMarkerCircle getNSTextListMarkerCircle()
-SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerDisc, NSString *)
+SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerDisc, NSTextListMarkerFormat)
 #define NSTextListMarkerDisc getNSTextListMarkerDisc()
-SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerSquare, NSString *)
+SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerSquare, NSTextListMarkerFormat)
 #define NSTextListMarkerSquare getNSTextListMarkerSquare()
-SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerLowercaseHexadecimal, NSString *)
+SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerLowercaseHexadecimal, NSTextListMarkerFormat)
 #define NSTextListMarkerLowercaseHexadecimal getNSTextListMarkerLowercaseHexadecimal()
-SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerUppercaseHexadecimal, NSString *)
+SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerUppercaseHexadecimal, NSTextListMarkerFormat)
 #define NSTextListMarkerUppercaseHexadecimal getNSTextListMarkerUppercaseHexadecimal()
-SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerOctal, NSString *)
+SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerOctal, NSTextListMarkerFormat)
 #define NSTextListMarkerOctal getNSTextListMarkerOctal()
-SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerLowercaseAlpha, NSString *)
+SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerLowercaseAlpha, NSTextListMarkerFormat)
 #define NSTextListMarkerLowercaseAlpha getNSTextListMarkerLowercaseAlpha()
-SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerUppercaseAlpha, NSString *)
+SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerUppercaseAlpha, NSTextListMarkerFormat)
 #define NSTextListMarkerUppercaseAlpha getNSTextListMarkerUppercaseAlpha()
-SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerLowercaseLatin, NSString *)
+SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerLowercaseLatin, NSTextListMarkerFormat)
 #define NSTextListMarkerLowercaseLatin getNSTextListMarkerLowercaseLatin()
-SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerUppercaseLatin, NSString *)
+SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerUppercaseLatin, NSTextListMarkerFormat)
 #define NSTextListMarkerUppercaseLatin getNSTextListMarkerUppercaseLatin()
-SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerLowercaseRoman, NSString *)
+SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerLowercaseRoman, NSTextListMarkerFormat)
 #define NSTextListMarkerLowercaseRoman getNSTextListMarkerLowercaseRoman()
-SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerUppercaseRoman, NSString *)
+SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerUppercaseRoman, NSTextListMarkerFormat)
 #define NSTextListMarkerUppercaseRoman getNSTextListMarkerUppercaseRoman()
-SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerDecimal, NSString *)
+SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerDecimal, NSTextListMarkerFormat)
 #define NSTextListMarkerDecimal getNSTextListMarkerDecimal()
 
 // We don't softlink NSSuperscriptAttributeName because UIFoundation stopped exporting it.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to