Skip to content

Commit

Permalink
Support building on Windows with Clang MSVC target
Browse files Browse the repository at this point in the history
  • Loading branch information
triplef committed Feb 3, 2021
1 parent ece6fc9 commit 61709e6
Show file tree
Hide file tree
Showing 174 changed files with 991 additions and 320 deletions.
189 changes: 189 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,195 @@
Use statbuf.st_mtim to get nanosecond precision in modification
date, also fix conversion of nanoseconds in creation date.

2021-01-29 Frederik Seiffert <[email protected]>

* Headers/Foundation/NSAffineTransform.h:
* Headers/Foundation/NSAppleEventDescriptor.h:
* Headers/Foundation/NSAppleEventManager.h:
* Headers/Foundation/NSAppleScript.h:
* Headers/Foundation/NSArchiver.h:
* Headers/Foundation/NSArray.h:
* Headers/Foundation/NSAttributedString.h:
* Headers/Foundation/NSAutoreleasePool.h:
* Headers/Foundation/NSBackgroundActivityScheduler.h:
* Headers/Foundation/NSBundle.h:
* Headers/Foundation/NSByteCountFormatter.h:
* Headers/Foundation/NSCache.h:
* Headers/Foundation/NSCalendar.h:
* Headers/Foundation/NSCalendarDate.h:
* Headers/Foundation/NSCharacterSet.h:
* Headers/Foundation/NSClassDescription.h:
* Headers/Foundation/NSCoder.h:
* Headers/Foundation/NSComparisonPredicate.h:
* Headers/Foundation/NSCompoundPredicate.h:
* Headers/Foundation/NSConnection.h:
* Headers/Foundation/NSData.h:
* Headers/Foundation/NSDate.h:
* Headers/Foundation/NSDateComponentsFormatter.h:
* Headers/Foundation/NSDateFormatter.h:
* Headers/Foundation/NSDateInterval.h:
* Headers/Foundation/NSDateIntervalFormatter.h:
* Headers/Foundation/NSDictionary.h:
* Headers/Foundation/NSDistantObject.h:
* Headers/Foundation/NSDistributedLock.h:
* Headers/Foundation/NSEnergyFormatter.h:
* Headers/Foundation/NSEnumerator.h:
* Headers/Foundation/NSError.h:
* Headers/Foundation/NSException.h:
* Headers/Foundation/NSExpression.h:
* Headers/Foundation/NSExtensionContext.h:
* Headers/Foundation/NSExtensionItem.h:
* Headers/Foundation/NSFileCoordinator.h:
* Headers/Foundation/NSFileHandle.h:
* Headers/Foundation/NSFileManager.h:
* Headers/Foundation/NSFileVersion.h:
* Headers/Foundation/NSFileWrapper.h:
* Headers/Foundation/NSGarbageCollector.h:
* Headers/Foundation/NSHTTPCookie.h:
* Headers/Foundation/NSHTTPCookieStorage.h:
* Headers/Foundation/NSHashTable.h:
* Headers/Foundation/NSHost.h:
* Headers/Foundation/NSISO8601DateFormatter.h:
* Headers/Foundation/NSInvocation.h:
* Headers/Foundation/NSInvocationOperation.h:
* Headers/Foundation/NSItemProvider.h:
* Headers/Foundation/NSItemProviderReadingWriting.h:
* Headers/Foundation/NSJSONSerialization.h:
* Headers/Foundation/NSKeyedArchiver.h:
* Headers/Foundation/NSLengthFormatter.h:
* Headers/Foundation/NSLinguisticTagger.h:
* Headers/Foundation/NSLocale.h:
* Headers/Foundation/NSLock.h:
* Headers/Foundation/NSMapTable.h:
* Headers/Foundation/NSMassFormatter.h:
* Headers/Foundation/NSMeasurement.h:
* Headers/Foundation/NSMeasurementFormatter.h:
* Headers/Foundation/NSMetadata.h:
* Headers/Foundation/NSMethodSignature.h:
* Headers/Foundation/NSNetServices.h:
* Headers/Foundation/NSNotification.h:
* Headers/Foundation/NSNotificationQueue.h:
* Headers/Foundation/NSNumberFormatter.h:
* Headers/Foundation/NSObjCRuntime.h:
* Headers/Foundation/NSObject.h:
* Headers/Foundation/NSObjectScripting.h:
* Headers/Foundation/NSOperation.h:
* Headers/Foundation/NSOrderedSet.h:
* Headers/Foundation/NSOrthography.h:
* Headers/Foundation/NSPersonNameComponents.h:
* Headers/Foundation/NSPersonNameComponentsFormatter.h:
* Headers/Foundation/NSPointerArray.h:
* Headers/Foundation/NSPointerFunctions.h:
* Headers/Foundation/NSPort.h:
* Headers/Foundation/NSPortCoder.h:
* Headers/Foundation/NSPortNameServer.h:
* Headers/Foundation/NSPredicate.h:
* Headers/Foundation/NSProcessInfo.h:
* Headers/Foundation/NSProgress.h:
* Headers/Foundation/NSPropertyList.h:
* Headers/Foundation/NSProtocolChecker.h:
* Headers/Foundation/NSProxy.h:
* Headers/Foundation/NSRegularExpression.h:
* Headers/Foundation/NSRunLoop.h:
* Headers/Foundation/NSScanner.h:
* Headers/Foundation/NSScriptClassDescription.h:
* Headers/Foundation/NSScriptCoercionHandler.h:
* Headers/Foundation/NSScriptCommand.h:
* Headers/Foundation/NSScriptCommandDescription.h:
* Headers/Foundation/NSScriptExecutionContext.h:
* Headers/Foundation/NSScriptKeyValueCoding.h:
* Headers/Foundation/NSScriptObjectSpecifiers.h:
* Headers/Foundation/NSScriptStandardSuiteCommands.h:
* Headers/Foundation/NSScriptSuiteRegistry.h:
* Headers/Foundation/NSSerialization.h:
* Headers/Foundation/NSSet.h:
* Headers/Foundation/NSSortDescriptor.h:
* Headers/Foundation/NSSpellServer.h:
* Headers/Foundation/NSStream.h:
* Headers/Foundation/NSString.h:
* Headers/Foundation/NSTask.h:
* Headers/Foundation/NSTextCheckingResult.h:
* Headers/Foundation/NSThread.h:
* Headers/Foundation/NSTimeZone.h:
* Headers/Foundation/NSTimer.h:
* Headers/Foundation/NSURL.h:
* Headers/Foundation/NSURLAuthenticationChallenge.h:
* Headers/Foundation/NSURLCache.h:
* Headers/Foundation/NSURLConnection.h:
* Headers/Foundation/NSURLCredential.h:
* Headers/Foundation/NSURLCredentialStorage.h:
* Headers/Foundation/NSURLDownload.h:
* Headers/Foundation/NSURLHandle.h:
* Headers/Foundation/NSURLProtectionSpace.h:
* Headers/Foundation/NSURLProtocol.h:
* Headers/Foundation/NSURLRequest.h:
* Headers/Foundation/NSURLResponse.h:
* Headers/Foundation/NSURLSession.h:
* Headers/Foundation/NSUUID.h:
* Headers/Foundation/NSUbiquitousKeyValueStore.h:
* Headers/Foundation/NSUndoManager.h:
* Headers/Foundation/NSUnit.h:
* Headers/Foundation/NSUserActivity.h:
* Headers/Foundation/NSUserDefaults.h:
* Headers/Foundation/NSUserNotification.h:
* Headers/Foundation/NSUserScriptTask.h:
* Headers/Foundation/NSValue.h:
* Headers/Foundation/NSValueTransformer.h:
* Headers/Foundation/NSXMLDTD.h:
* Headers/Foundation/NSXMLDTDNode.h:
* Headers/Foundation/NSXMLDocument.h:
* Headers/Foundation/NSXMLElement.h:
* Headers/Foundation/NSXMLNode.h:
* Headers/Foundation/NSXMLParser.h:
* Headers/Foundation/NSXPCConnection.h:
* Headers/GNUstepBase/CXXException.h:
* Headers/GNUstepBase/GCObject.h:
* Headers/GNUstepBase/GSConfig.h.in:
* Headers/GNUstepBase/GSMime.h:
* Headers/GNUstepBase/GSTLS.h:
* Headers/GNUstepBase/GSVersionMacros.h:
* Headers/GNUstepBase/GSXML.h:
* Headers/GNUstepBase/NSStream+GNUstepBase.h:
* Source/Additions/GSXML.m:
* Source/Additions/Makefile.preamble:
* Source/CXXException.m:
* Source/GNUmakefile:
* Source/NSException.m:
* Source/NSFileManager.m:
* Source/NSPropertyList.m:
* Source/NSSocketPort.m:
* Source/ObjectiveC2/Makefile.preamble:
* Source/common.h:
* Source/externs.m:
* Source/inet_ntop.m:
* Source/inet_pton.m:
* Source/libgnustep-base-entry.m:
* Source/unix/Makefile.preamble:
* Source/win32/GSFileHandle.m:
* Source/win32/Makefile.preamble:
* Tools/GNUmakefile:
* Tools/Makefile.preamble:
* Tools/gdnc.m:
* Tools/make_strings/make_strings.m:
* Tools/pl2link.m:
* Tools/plutil.m:
* config/config.initialize.m:
* configure:
* configure.ac:
Added support for building on Windows with Clang MSVC target and
libobjc2. This requires using a standard (non-MinGW) Clang build that
e.g. comes with Visual Studio or is available as pre-built binary from
the LLVM website, and requires passing a host to configure like
--host=x86_64-pc-windows.
The build is best done in an MSYS2 shell that does not have any
additional *-devel packages installed that might get picked up by
configure. Alternatively --disable-xxx flags can be used to prevent
these dependencies to be picked up.
Annotates all ObjC class interfaces with GS_EXPORT_CLASS for DLL
export/import declarations, and adds missing GS_DECLARE annotations
in externs.m, in order for these symbols to be correctly exported
in the DLL.

2021-01-21 Fred Kiefer <[email protected]>

* Tools/pl2link.m (main): Set key StartupWMClass and allow file
Expand Down
1 change: 1 addition & 0 deletions Headers/Foundation/NSAffineTransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ typedef struct {
CGFloat tY;
} NSAffineTransformStruct;

GS_EXPORT_CLASS
@interface NSAffineTransform : NSObject <NSCopying, NSCoding>
{
#if GS_EXPOSE(NSAffineTransform)
Expand Down
1 change: 1 addition & 0 deletions Headers/Foundation/NSAppleEventDescriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
extern "C" {
#endif

GS_EXPORT_CLASS
@interface NSAppleEventDescriptor : NSObject

@end
Expand Down
1 change: 1 addition & 0 deletions Headers/Foundation/NSAppleEventManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
extern "C" {
#endif

GS_EXPORT_CLASS
@interface NSAppleEventManager : NSObject

@end
Expand Down
1 change: 1 addition & 0 deletions Headers/Foundation/NSAppleScript.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ extern "C" {

#if OS_API_VERSION(MAC_OS_X_VERSION_10_0, GS_API_LATEST)

GS_EXPORT_CLASS
@interface NSAppleScript : NSObject

@end
Expand Down
4 changes: 3 additions & 1 deletion Headers/Foundation/NSArchiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ extern "C" {

#if OS_API_VERSION(GS_API_OSSPEC,GS_API_LATEST)

GS_EXPORT_CLASS
@interface NSArchiver : NSCoder
{
#if GS_EXPOSE(NSArchiver)
Expand Down Expand Up @@ -157,8 +158,9 @@ extern "C" {
@end
#endif




GS_EXPORT_CLASS
@interface NSUnarchiver : NSCoder
{
#if GS_EXPOSE(NSUnarchiver)
Expand Down
4 changes: 3 additions & 1 deletion Headers/Foundation/NSArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ enum
typedef NSUInteger NSBinarySearchingOptions;
#endif

GS_EXPORT_CLASS
@interface GS_GENERIC_CLASS(NSArray, __covariant ElementT) : NSObject
<NSCoding, NSCopying, NSMutableCopying, NSFastEnumeration>

Expand Down Expand Up @@ -300,7 +301,8 @@ DEFINE_BLOCK_TYPE(GSPredicateBlock, BOOL, GS_GENERIC_TYPE(ElementT), NSUInteger,
- (GS_GENERIC_TYPE(ElementT)) objectAtIndexedSubscript: (NSUInteger)anIndex;
@end



GS_EXPORT_CLASS
@interface GS_GENERIC_CLASS(NSMutableArray, ElementT) : GS_GENERIC_CLASS(NSArray, ElementT)

+ (instancetype) arrayWithCapacity: (NSUInteger)numItems;
Expand Down
2 changes: 2 additions & 0 deletions Headers/Foundation/NSAttributedString.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ extern "C" {
#import <Foundation/NSArray.h>
#import <Foundation/NSCoder.h>

GS_EXPORT_CLASS
@interface NSAttributedString : NSObject <NSCoding, NSCopying, NSMutableCopying>
{
}
Expand Down Expand Up @@ -100,6 +101,7 @@ extern "C" {
@end //NSAttributedString


GS_EXPORT_CLASS
@interface NSMutableAttributedString : NSAttributedString
{
}
Expand Down
4 changes: 2 additions & 2 deletions Headers/Foundation/NSAutoreleasePool.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ typedef struct autorelease_array_list
* </desc>
* </deflist>
*/
NS_AUTOMATED_REFCOUNT_UNAVAILABLE
@interface NSAutoreleasePool : NSObject
GS_EXPORT_CLASS NS_AUTOMATED_REFCOUNT_UNAVAILABLE
@interface NSAutoreleasePool : NSObject
{
#if GS_EXPOSE(NSAutoreleasePool) && !__has_feature(objc_arc)
/* For re-setting the current pool when we are dealloc'ed. */
Expand Down
1 change: 1 addition & 0 deletions Headers/Foundation/NSBackgroundActivityScheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ typedef NSInteger NSQualityOfService;
DEFINE_BLOCK_TYPE(GSScheduledBlock, void, NSBackgroundActivityCompletionHandler);
//# endif

GS_EXPORT_CLASS
@interface NSBackgroundActivityScheduler : NSObject
{
NSString *_identifier;
Expand Down
1 change: 1 addition & 0 deletions Headers/Foundation/NSBundle.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ GS_EXPORT NSString* const NSLoadedClasses;
bundle.
</p>
*/
GS_EXPORT_CLASS
@interface NSBundle : NSObject
{
#if GS_EXPOSE(NSBundle)
Expand Down
3 changes: 2 additions & 1 deletion Headers/Foundation/NSByteCountFormatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ enum {
NSByteCountFormatterCountStyleBinary = 3,
};
typedef NSInteger NSByteCountFormatterCountStyle;


GS_EXPORT_CLASS
@interface NSByteCountFormatter : NSFormatter
{
#if GS_EXPOSE(NSByteCountFormatter)
Expand Down
1 change: 1 addition & 0 deletions Headers/Foundation/NSCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ extern "C" {
@class NSMapTable;
@class GS_GENERIC_CLASS(NSMutableArray, ElementT);

GS_EXPORT_CLASS
@interface GS_GENERIC_CLASS(NSCache, KeyT, ValT) : NSObject
{
#if GS_EXPOSE(NSCache)
Expand Down
2 changes: 2 additions & 0 deletions Headers/Foundation/NSCalendar.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ enum



GS_EXPORT_CLASS
@interface NSDateComponents : NSObject <NSCopying>
{
@private
Expand Down Expand Up @@ -262,6 +263,7 @@ enum



GS_EXPORT_CLASS
@interface NSCalendar : NSObject <NSCoding, NSCopying>
{
@private
Expand Down
1 change: 1 addition & 0 deletions Headers/Foundation/NSCalendarDate.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ extern "C" {
@class NSTimeZone;
@class NSTimeZoneDetail;

GS_EXPORT_CLASS
@interface NSCalendarDate : NSDate
{
#if GS_EXPOSE(NSCalendarDate)
Expand Down
2 changes: 2 additions & 0 deletions Headers/Foundation/NSCharacterSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ extern "C" {
* Represents a set of unicode characters. Used by [NSScanner] and [NSString]
* for parsing-related methods.
*/
GS_EXPORT_CLASS
@interface NSCharacterSet : NSObject <NSCoding, NSCopying, NSMutableCopying>

/**
Expand Down Expand Up @@ -238,6 +239,7 @@ extern "C" {
/**
* An [NSCharacterSet] that can be modified.
*/
GS_EXPORT_CLASS
@interface NSMutableCharacterSet : NSCharacterSet

/**
Expand Down
1 change: 1 addition & 0 deletions Headers/Foundation/NSClassDescription.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ extern "C" {
*/
GS_EXPORT NSString* const NSClassDescriptionNeededForClassNotification;

GS_EXPORT_CLASS
@interface NSClassDescription : NSObject

+ (NSClassDescription*) classDescriptionForClass: (Class)aClass;
Expand Down
1 change: 1 addition & 0 deletions Headers/Foundation/NSCoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ extern "C" {
* preferred for new implementations, since they provide greater
* forward/backward compatibility in the face of class changes.</p>
*/
GS_EXPORT_CLASS
@interface NSCoder : NSObject
// Encoding Data

Expand Down
1 change: 1 addition & 0 deletions Headers/Foundation/NSComparisonPredicate.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ typedef enum _NSPredicateOperatorType
#endif
} NSPredicateOperatorType;

GS_EXPORT_CLASS
@interface NSComparisonPredicate : NSPredicate
{
#if GS_EXPOSE(NSComparisonPredicate)
Expand Down
1 change: 1 addition & 0 deletions Headers/Foundation/NSCompoundPredicate.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ enum
};
typedef NSUInteger NSCompoundPredicateType;

GS_EXPORT_CLASS
@interface NSCompoundPredicate : NSPredicate
{
#if GS_EXPOSE(NSCompoundPredicate)
Expand Down
Loading

0 comments on commit 61709e6

Please sign in to comment.