Index: src/OFFileManager.m ================================================================== --- src/OFFileManager.m +++ src/OFFileManager.m @@ -71,43 +71,11 @@ #endif @interface OFDefaultFileManager: OFFileManager @end -const of_file_attribute_key_t of_file_attribute_key_size = - @"of_file_attribute_key_size"; -const of_file_attribute_key_t of_file_attribute_key_type = - @"of_file_attribute_key_type"; -const of_file_attribute_key_t of_file_attribute_key_posix_permissions = - @"of_file_attribute_key_posix_permissions"; -const of_file_attribute_key_t of_file_attribute_key_posix_uid = - @"of_file_attribute_key_posix_uid"; -const of_file_attribute_key_t of_file_attribute_key_posix_gid = - @"of_file_attribute_key_posix_gid"; -const of_file_attribute_key_t of_file_attribute_key_owner = - @"of_file_attribute_key_owner"; -const of_file_attribute_key_t of_file_attribute_key_group = - @"of_file_attribute_key_group"; -const of_file_attribute_key_t of_file_attribute_key_last_access_date = - @"of_file_attribute_key_last_access_date"; -const of_file_attribute_key_t of_file_attribute_key_modification_date = - @"of_file_attribute_key_modification_date"; -const of_file_attribute_key_t of_file_attribute_key_status_change_date = - @"of_file_attribute_key_status_change_date"; -const of_file_attribute_key_t of_file_attribute_key_creation_date = - @"of_file_attribute_key_creation_date"; -const of_file_attribute_key_t of_file_attribute_key_symbolic_link_destination = - @"of_file_attribute_key_symbolic_link_destination"; - -const of_file_type_t of_file_type_regular = @"of_file_type_regular"; -const of_file_type_t of_file_type_directory = @"of_file_type_directory"; -const of_file_type_t of_file_type_symbolic_link = @"of_file_type_symbolic_link"; -const of_file_type_t of_file_type_fifo = @"of_file_type_fifo"; -const of_file_type_t of_file_type_character_special = - @"of_file_type_character_special"; -const of_file_type_t of_file_type_block_special = @"of_file_type_block_special"; -const of_file_type_t of_file_type_socket = @"of_file_type_socket"; +#include "OFFileManager_constants.m" #ifdef OF_AMIGAOS4 # define CurrentDir(lock) SetCurrentDir(lock) #endif ADDED src/OFFileManager_constants.m Index: src/OFFileManager_constants.m ================================================================== --- src/OFFileManager_constants.m +++ src/OFFileManager_constants.m @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, + * 2018, 2019, 2020 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +const of_file_attribute_key_t of_file_attribute_key_size = + @"of_file_attribute_key_size"; +const of_file_attribute_key_t of_file_attribute_key_type = + @"of_file_attribute_key_type"; +const of_file_attribute_key_t of_file_attribute_key_posix_permissions = + @"of_file_attribute_key_posix_permissions"; +const of_file_attribute_key_t of_file_attribute_key_posix_uid = + @"of_file_attribute_key_posix_uid"; +const of_file_attribute_key_t of_file_attribute_key_posix_gid = + @"of_file_attribute_key_posix_gid"; +const of_file_attribute_key_t of_file_attribute_key_owner = + @"of_file_attribute_key_owner"; +const of_file_attribute_key_t of_file_attribute_key_group = + @"of_file_attribute_key_group"; +const of_file_attribute_key_t of_file_attribute_key_last_access_date = + @"of_file_attribute_key_last_access_date"; +const of_file_attribute_key_t of_file_attribute_key_modification_date = + @"of_file_attribute_key_modification_date"; +const of_file_attribute_key_t of_file_attribute_key_status_change_date = + @"of_file_attribute_key_status_change_date"; +const of_file_attribute_key_t of_file_attribute_key_creation_date = + @"of_file_attribute_key_creation_date"; +const of_file_attribute_key_t of_file_attribute_key_symbolic_link_destination = + @"of_file_attribute_key_symbolic_link_destination"; + +const of_file_type_t of_file_type_regular = @"of_file_type_regular"; +const of_file_type_t of_file_type_directory = @"of_file_type_directory"; +const of_file_type_t of_file_type_symbolic_link = @"of_file_type_symbolic_link"; +const of_file_type_t of_file_type_fifo = @"of_file_type_fifo"; +const of_file_type_t of_file_type_character_special = + @"of_file_type_character_special"; +const of_file_type_t of_file_type_block_special = @"of_file_type_block_special"; +const of_file_type_t of_file_type_socket = @"of_file_type_socket"; Index: src/OFRunLoop.m ================================================================== --- src/OFRunLoop.m +++ src/OFRunLoop.m @@ -43,11 +43,11 @@ #import "OFTimer+Private.h" #import "OFDate.h" #import "OFObserveFailedException.h" -const of_run_loop_mode_t of_run_loop_mode_default = @"of_run_loop_mode_default"; +#include "OFRunLoop_constants.m" static OFRunLoop *mainRunLoop = nil; @interface OFRunLoopState: OFObject #ifdef OF_HAVE_SOCKETS ADDED src/OFRunLoop_constants.m Index: src/OFRunLoop_constants.m ================================================================== --- src/OFRunLoop_constants.m +++ src/OFRunLoop_constants.m @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, + * 2018, 2019, 2020 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +const of_run_loop_mode_t of_run_loop_mode_default = @"of_run_loop_mode_default"; Index: src/linklib/linklib.m ================================================================== --- src/linklib/linklib.m +++ src/linklib/linklib.m @@ -22,10 +22,51 @@ #import "macros.h" #include struct ObjFWBase; + +#import "inline.h" + +#include +#include +#include + +#if defined(OF_AMIGAOS_M68K) +# include +# define SYM(name) __asm__("_" name) +#elif defined(OF_MORPHOS) +# include +# define SYM(name) __asm__(name) +#endif + +#ifdef HAVE_SJLJ_EXCEPTIONS +extern int _Unwind_SjLj_RaiseException(void *); +#else +extern int _Unwind_RaiseException(void *); +#endif +extern void _Unwind_DeleteException(void *); +extern void *_Unwind_GetLanguageSpecificData(void *); +extern uintptr_t _Unwind_GetRegionStart(void *); +extern uintptr_t _Unwind_GetDataRelBase(void *); +extern uintptr_t _Unwind_GetTextRelBase(void *); +extern uintptr_t _Unwind_GetIP(void *); +extern uintptr_t _Unwind_GetGR(void *, int); +extern void _Unwind_SetIP(void *, uintptr_t); +extern void _Unwind_SetGR(void *, int, uintptr_t); +#ifdef HAVE_SJLJ_EXCEPTIONS +extern void _Unwind_SjLj_Resume(void *); +#else +extern void _Unwind_Resume(void *); +#endif +#ifdef OF_AMIGAOS_M68K +extern void __register_frame_info(const void *, void *); +extern void *__deregister_frame_info(const void *); +#endif +extern int _Unwind_Backtrace(int (*)(void *, void *), void *); + +struct Library *ObjFWBase; void *__objc_class_name_OFASN1BitString; void *__objc_class_name_OFASN1Boolean; void *__objc_class_name_OFASN1Enumerated; void *__objc_class_name_OFASN1IA5String; void *__objc_class_name_OFASN1Integer; @@ -219,51 +260,12 @@ void *__objc_class_name_OFConditionWaitFailedException; void *__objc_class_name_OFThreadJoinFailedException; void *__objc_class_name_OFThreadStartFailedException; void *__objc_class_name_OFThreadStillRunningException; #endif - -#import "inline.h" - -#include -#include -#include - -#if defined(OF_AMIGAOS_M68K) -# include -# define SYM(name) __asm__("_" name) -#elif defined(OF_MORPHOS) -# include -# define SYM(name) __asm__(name) -#endif - -#ifdef HAVE_SJLJ_EXCEPTIONS -extern int _Unwind_SjLj_RaiseException(void *); -#else -extern int _Unwind_RaiseException(void *); -#endif -extern void _Unwind_DeleteException(void *); -extern void *_Unwind_GetLanguageSpecificData(void *); -extern uintptr_t _Unwind_GetRegionStart(void *); -extern uintptr_t _Unwind_GetDataRelBase(void *); -extern uintptr_t _Unwind_GetTextRelBase(void *); -extern uintptr_t _Unwind_GetIP(void *); -extern uintptr_t _Unwind_GetGR(void *, int); -extern void _Unwind_SetIP(void *, uintptr_t); -extern void _Unwind_SetGR(void *, int, uintptr_t); -#ifdef HAVE_SJLJ_EXCEPTIONS -extern void _Unwind_SjLj_Resume(void *); -#else -extern void _Unwind_Resume(void *); -#endif -#ifdef OF_AMIGAOS_M68K -extern void __register_frame_info(const void *, void *); -extern void *__deregister_frame_info(const void *); -#endif -extern int _Unwind_Backtrace(int (*)(void *, void *), void *); - -struct Library *ObjFWBase; +#include "OFFileManager_constants.m" +#include "OFRunLoop_constants.m" static void __attribute__((__used__)) ctor(void) { static bool initialized = false;