ObjFW  Check-in [476483dd19]

Overview
Comment:platform.h: Add OF_ANDROID and OF_DJGPP
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 476483dd19ddd52c9e8dc5113e63b5206311fe81515306b0999ead488e8c323f
User & Date: js on 2017-05-28 23:38:38
Other Links: manifest | tags
Context
2017-05-29
21:55
macros.h: Add OF_ALIGNAS check-in: c2a2107f79 user: js tags: trunk
2017-05-28
23:38
platform.h: Add OF_ANDROID and OF_DJGPP check-in: 476483dd19 user: js tags: trunk
21:29
OFFile: Use AmigaDOS API on MorphOS + libnix check-in: 7a0f290eae user: js tags: trunk
Changes

Modified src/OFSeekableStream.h from [2dafdfc3cf] to [8acc79141d].

25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

#import "OFStream.h"

OF_ASSUME_NONNULL_BEGIN

#if defined(OF_WINDOWS)
typedef __int64 of_offset_t;
#elif defined(__ANDROID__)
typedef long long of_offset_t;
#elif defined(OF_MORPHOS) && !defined(OF_IXEMUL)
typedef signed long long of_offset_t;
#elif defined(OF_HAVE_OFF64_T)
typedef off64_t of_offset_t;
#else
typedef off_t of_offset_t;







|







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

#import "OFStream.h"

OF_ASSUME_NONNULL_BEGIN

#if defined(OF_WINDOWS)
typedef __int64 of_offset_t;
#elif defined(OF_ANDROID)
typedef long long of_offset_t;
#elif defined(OF_MORPHOS) && !defined(OF_IXEMUL)
typedef signed long long of_offset_t;
#elif defined(OF_HAVE_OFF64_T)
typedef off64_t of_offset_t;
#else
typedef off_t of_offset_t;

Modified src/OFThread.m from [d1aa6904ee] to [27186ac8aa].

79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# import "OFThreadStillRunningException.h"
#endif

#ifdef OF_HAVE_ATOMIC_OPS
# import "atomic.h"
#endif

#ifdef __DJGPP__
# define lrint(x) rint(x)
#endif

#ifdef OF_HAVE_THREADS
# import "threading.h"

static of_tlskey_t threadSelfKey;







|







79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# import "OFThreadStillRunningException.h"
#endif

#ifdef OF_HAVE_ATOMIC_OPS
# import "atomic.h"
#endif

#ifdef OF_DJGPP
# define lrint(x) rint(x)
#endif

#ifdef OF_HAVE_THREADS
# import "threading.h"

static of_tlskey_t threadSelfKey;

Modified src/platform.h from [d2b1abebc4] to [24783424a3].

88
89
90
91
92
93
94


95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110

111
112
113
114
115
116
117
118
119
120
121
122
# define OF_FREEBSD
#elif defined(__NetBSD__)
# define OF_NETBSD
#elif defined(__OpenBSD__)
# define OF_OPENBSD
#elif defined(__DragonFly__)
# define OF_DRAGONFLYBSD


#elif defined(__HAIKU__)
# define OF_HAIKU
#elif defined(__MORPHOS__)
# define OF_MORPHOS
# ifdef __ixemul__
#  define OF_IXEMUL
# endif
#elif defined(__sun__)
# define OF_SOLARIS
#elif defined(__QNX__)
# define OF_QNX
#elif defined(__wii__)
# define OF_WII
#elif defined(_PSP)
# define OF_PSP
#elif defined(__DJGPP__)

# define OF_MSDOS
#endif

#if defined(__ELF__)
# define OF_ELF
#elif defined(__MACH__)
# define OF_MACH_O
#endif

#if defined(__PIC__) || defined(__pic__)
# define OF_PIC
#endif







>
>
















>












88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# define OF_FREEBSD
#elif defined(__NetBSD__)
# define OF_NETBSD
#elif defined(__OpenBSD__)
# define OF_OPENBSD
#elif defined(__DragonFly__)
# define OF_DRAGONFLYBSD
#elif defined(__ANDROID__)
# define OF_ANDROID
#elif defined(__HAIKU__)
# define OF_HAIKU
#elif defined(__MORPHOS__)
# define OF_MORPHOS
# ifdef __ixemul__
#  define OF_IXEMUL
# endif
#elif defined(__sun__)
# define OF_SOLARIS
#elif defined(__QNX__)
# define OF_QNX
#elif defined(__wii__)
# define OF_WII
#elif defined(_PSP)
# define OF_PSP
#elif defined(__DJGPP__)
# define OF_DJGPP
# define OF_MSDOS
#endif

#if defined(__ELF__)
# define OF_ELF
#elif defined(__MACH__)
# define OF_MACH_O
#endif

#if defined(__PIC__) || defined(__pic__)
# define OF_PIC
#endif

Modified tests/OFStringTests.m from [80a03e0c8f] to [0bb9c53c1a].

654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
	 * floating point numbers, thus we can use == on them.
	 */
	TEST(@"-[floatValue]",
	    [C(@"\t-0.25 ") floatValue] == -0.25 &&
	    [C(@"\r-INFINITY\n") floatValue] == -INFINITY &&
	    isnan([C(@"   NAN\t\t") floatValue]))

#if !defined(__ANDROID__) && !defined(OF_SOLARIS) && !defined(__DJGPP__)
# define INPUT @"\t-0x1.FFFFFFFFFFFFFP-1020 "
# define EXPECTED -0x1.FFFFFFFFFFFFFP-1020
#else
/* Android, Solaris and DJGPP do not accept 0x for strtod() */
# if !defined(OF_SOLARIS) || !defined(OF_X86)
#  define INPUT @"\t-0.123456789 "
#  define EXPECTED -0.123456789







|







654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
	 * floating point numbers, thus we can use == on them.
	 */
	TEST(@"-[floatValue]",
	    [C(@"\t-0.25 ") floatValue] == -0.25 &&
	    [C(@"\r-INFINITY\n") floatValue] == -INFINITY &&
	    isnan([C(@"   NAN\t\t") floatValue]))

#if !defined(OF_ANDROID) && !defined(OF_SOLARIS) && !defined(OF_DJGPP)
# define INPUT @"\t-0x1.FFFFFFFFFFFFFP-1020 "
# define EXPECTED -0x1.FFFFFFFFFFFFFP-1020
#else
/* Android, Solaris and DJGPP do not accept 0x for strtod() */
# if !defined(OF_SOLARIS) || !defined(OF_X86)
#  define INPUT @"\t-0.123456789 "
#  define EXPECTED -0.123456789