⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 285811 in webkit


Ignore:
Timestamp:
Nov 15, 2021, 10:36:47 AM (5 years ago)
Author:
Wenson Hsieh
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:
Location:
trunk/Source/WebCore/PAL
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/PAL/ChangeLog

    r285794 r285811  
     12021-11-15  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Declare NSTextListMarker* as type NSTextListMarkerFormat when soft-linking
     4        https://bugs.webkit.org/show_bug.cgi?id=233064
     5        rdar://85341122
     6
     7        Reviewed by Tim Horton.
     8
     9        Followup to r285744. Avoid build errors due to defining these constants as a different type of symbol
     10        (NSString * vs. NSTextListMarkerFormat). To address this, we directly import `NSTextList.h` if it's available in
     11        the SDK; otherwise, fall back to defining NSTextListMarkerFormat. In both cases, we need to keep soft linking
     12        each of these constants, since WebCore cannot explicitly link against UIKit.
     13
     14        * pal/spi/cocoa/NSAttributedStringSPI.h:
     15
    1162021-11-14  Myles C. Maxfield  <mmaxfield@apple.com>
    217
  • trunk/Source/WebCore/PAL/pal/spi/cocoa/NSAttributedStringSPI.h

    r285744 r285811  
    9696SOFT_LINK_CONSTANT(UIFoundation, NSTextAlternativesAttributeName, NSString *)
    9797#define NSTextAlternativesAttributeName getNSTextAlternativesAttributeName()
    98 SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerCircle, NSString *)
     98
     99#if __has_include(<UIKit/NSTextList.h>)
     100#import <UIKit/NSTextList.h>
     101#else
     102typedef NSString *NSTextListMarkerFormat;
     103#endif
     104SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerCircle, NSTextListMarkerFormat)
    99105#define NSTextListMarkerCircle getNSTextListMarkerCircle()
    100 SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerDisc, NSString *)
     106SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerDisc, NSTextListMarkerFormat)
    101107#define NSTextListMarkerDisc getNSTextListMarkerDisc()
    102 SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerSquare, NSString *)
     108SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerSquare, NSTextListMarkerFormat)
    103109#define NSTextListMarkerSquare getNSTextListMarkerSquare()
    104 SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerLowercaseHexadecimal, NSString *)
     110SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerLowercaseHexadecimal, NSTextListMarkerFormat)
    105111#define NSTextListMarkerLowercaseHexadecimal getNSTextListMarkerLowercaseHexadecimal()
    106 SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerUppercaseHexadecimal, NSString *)
     112SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerUppercaseHexadecimal, NSTextListMarkerFormat)
    107113#define NSTextListMarkerUppercaseHexadecimal getNSTextListMarkerUppercaseHexadecimal()
    108 SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerOctal, NSString *)
     114SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerOctal, NSTextListMarkerFormat)
    109115#define NSTextListMarkerOctal getNSTextListMarkerOctal()
    110 SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerLowercaseAlpha, NSString *)
     116SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerLowercaseAlpha, NSTextListMarkerFormat)
    111117#define NSTextListMarkerLowercaseAlpha getNSTextListMarkerLowercaseAlpha()
    112 SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerUppercaseAlpha, NSString *)
     118SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerUppercaseAlpha, NSTextListMarkerFormat)
    113119#define NSTextListMarkerUppercaseAlpha getNSTextListMarkerUppercaseAlpha()
    114 SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerLowercaseLatin, NSString *)
     120SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerLowercaseLatin, NSTextListMarkerFormat)
    115121#define NSTextListMarkerLowercaseLatin getNSTextListMarkerLowercaseLatin()
    116 SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerUppercaseLatin, NSString *)
     122SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerUppercaseLatin, NSTextListMarkerFormat)
    117123#define NSTextListMarkerUppercaseLatin getNSTextListMarkerUppercaseLatin()
    118 SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerLowercaseRoman, NSString *)
     124SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerLowercaseRoman, NSTextListMarkerFormat)
    119125#define NSTextListMarkerLowercaseRoman getNSTextListMarkerLowercaseRoman()
    120 SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerUppercaseRoman, NSString *)
     126SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerUppercaseRoman, NSTextListMarkerFormat)
    121127#define NSTextListMarkerUppercaseRoman getNSTextListMarkerUppercaseRoman()
    122 SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerDecimal, NSString *)
     128SOFT_LINK_CONSTANT(UIFoundation, NSTextListMarkerDecimal, NSTextListMarkerFormat)
    123129#define NSTextListMarkerDecimal getNSTextListMarkerDecimal()
    124130
Note: See TracChangeset for help on using the changeset viewer.