ObjFW  Changes On Branch b7fc48b7343b3c4c

Changes In Branch 1.2 Excluding Merge-Ins

This is equivalent to a diff from c5f91347e7 to b7fc48b734

2024-11-18
23:34
Port to latest devkitARM Leaf check-in: b7fc48b734 user: js tags: 1.2
23:33
OFTLSStream: Ensure shutdown is sent with OpenSSL check-in: 957527d55e user: js tags: 1.2
2024-11-14
00:27
Port to latest devkitARM check-in: 23da92beab user: js tags: trunk
2024-11-07
21:17
Add support for MPTCP check-in: 49f5cd5ec5 user: js tags: trunk
21:07
Merge trunk into 1.2 branch check-in: 10cce4f6ef user: js tags: 1.2
2024-11-06
21:28
objfw-compile: Remove handling of .bundle check-in: c5f91347e7 user: js tags: trunk
2024-11-05
23:48
GitHub Actions: Add ObjC++ test on 32 bit Ubuntu check-in: 77b155c1da user: js tags: trunk

Deleted .github/workflows/macos-12.yml version [2410a0204f].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: macos-12
on: [push, pull_request]
jobs:
  tests:
    runs-on: macos-12
    strategy:
      matrix:
        configure_flags:
          -
          - --disable-threads
          - --disable-threads --disable-sockets
          - --disable-threads --disable-files
          - --disable-threads --disable-sockets --disable-files
          - --disable-sockets
          - --disable-sockets --disable-files
          - --disable-files
          - --disable-shared
    steps:
    - name: Install dependencies
      run: brew install autoconf automake
    - uses: actions/checkout@v4
    - name: autogen.sh
      run: ./autogen.sh
    - name: configure
      run: ./configure ${{ matrix.configure_flags }}
    - name: make
      run: make -j$(sysctl -n hw.logicalcpu)
    - name: make check
      run: make check
    - name: make install
      run: sudo make install
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






























































Modified .github/workflows/msys2.yml from [f5ad4b3bf9] to [7d382818c3].

32
33
34
35
36
37
38





        run: make -j4
      - name: make check
        shell: msys2 {0}
        run: make check
      - name: make install
        shell: msys2 {0}
        run: make install












>
>
>
>
>
32
33
34
35
36
37
38
39
40
41
42
43
        run: make -j4
      - name: make check
        shell: msys2 {0}
        run: make check
      - name: make install
        shell: msys2 {0}
        run: make install
      - name: C++ test
        shell: msys2 {0}
        run: |
          objfw-compile -o cxxtest .github/workflows/CXXTest.mm
          ./cxxtest.exe

Modified .github/workflows/nintendo-ds.yml from [6b553d5781] to [19802372c6].

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27








28
29
30
31
32
33
34
35
    - uses: actions/checkout@v4
    - name: autogen.sh
      run: ./autogen.sh
    - name: configure
      run: |
        docker run \
          -e DEVKITPRO=/opt/devkitpro \
          -e PATH="/opt/devkitpro/devkitARM/bin:$PATH" \
          -v "$PWD:/objfw" \
          devkitpro/devkitarm \
          sh -c 'cd /objfw && ./configure --host=arm-none-eabi --with-nds'
    - name: make
      run: |
        docker run \
          -e DEVKITPRO=/opt/devkitpro \
          -e PATH="/opt/devkitpro/devkitARM/bin:$PATH" \
          -v "$PWD:/objfw" \
          devkitpro/devkitarm \
          sh -c "cd /objfw && make -j$(nproc)"








    - name: make install
      run: |
        docker run \
          -e DEVKITPRO=/opt/devkitpro \
          -e PATH="/opt/devkitpro/devkitARM/bin:$PATH" \
          -v "$PWD:/objfw" \
          devkitpro/devkitarm \
          sh -c "cd /objfw && make install"







|







|



>
>
>
>
>
>
>
>




|



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
    - uses: actions/checkout@v4
    - name: autogen.sh
      run: ./autogen.sh
    - name: configure
      run: |
        docker run \
          -e DEVKITPRO=/opt/devkitpro \
          -e PATH="/opt/devkitpro/devkitARM/bin:/opt/devkitpro/tools/bin:$PATH" \
          -v "$PWD:/objfw" \
          devkitpro/devkitarm \
          sh -c 'cd /objfw && ./configure --host=arm-none-eabi --with-nds'
    - name: make
      run: |
        docker run \
          -e DEVKITPRO=/opt/devkitpro \
          -e PATH="/opt/devkitpro/devkitARM/bin:/opt/devkitpro/tools/bin:$PATH" \
          -v "$PWD:/objfw" \
          devkitpro/devkitarm \
          sh -c "cd /objfw && make -j$(nproc)"
    - name: make tests.nds
      run: |
        docker run \
          -e DEVKITPRO=/opt/devkitpro \
          -e PATH="/opt/devkitpro/devkitARM/bin:/opt/devkitpro/tools/bin:$PATH" \
          -v "$PWD:/objfw" \
          devkitpro/devkitarm \
          sh -c "cd /objfw/tests && make tests.nds"
    - name: make install
      run: |
        docker run \
          -e DEVKITPRO=/opt/devkitpro \
          -e PATH="/opt/devkitpro/devkitARM/bin:/opt/devkitpro/tools/bin:$PATH" \
          -v "$PWD:/objfw" \
          devkitpro/devkitarm \
          sh -c "cd /objfw && make install"

Modified ChangeLog from [b178be0081] to [e45554a38f].

1
2
3
4
5
6






7
8
9
10
11
12
13
Legend:
 * Changes of existing features or bugfixes
 + New features

This file only contains the most significant changes.







ObjFW 1.1.7 -> ObjFW 1.2, 2024-11-02
 + Adds a new framework for game controllers called ObjFWHID.
 + Adds support for tagged pointer strings.
 + Strings are now allowed to contain `\0`, while preventing such strings from
   being passed to anything that expects a C string.
 * `\u0000` and `\x??` are now allowed in JSON.
 + Adds a new option `OFJSONRepresentationOptionSorted` to create sorted,






>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Legend:
 * Changes of existing features or bugfixes
 + New features

This file only contains the most significant changes.

ObjFW 1.2 -> ObjFW 1.2.1, 2024-11-09
 * Fixes exceptions in ObjC++.
 * Fixes compiling ObjC++ on Windows.
 * Fixes compiling tests on Haiku.
 * Properly hides private methods in ObjFWHID.

ObjFW 1.1.7 -> ObjFW 1.2, 2024-11-02
 + Adds a new framework for game controllers called ObjFWHID.
 + Adds support for tagged pointer strings.
 + Strings are now allowed to contain `\0`, while preventing such strings from
   being passed to anything that expects a C string.
 * `\u0000` and `\x??` are now allowed in JSON.
 + Adds a new option `OFJSONRepresentationOptionSorted` to create sorted,

Modified configure.ac from [b60b759470] to [1a1b33970e].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
AC_INIT(ObjFW, 1.3-dev, js@nil.im, objfw, https://objfw.nil.im/)
AC_CONFIG_SRCDIR(src)
AC_CONFIG_AUX_DIR(build-aux)
AC_CONFIG_MACRO_DIR(build-aux/m4)

AC_DEFINE(OBJFW_VERSION_MAJOR, 1, [The major version of ObjFW])
AC_DEFINE(OBJFW_VERSION_MINOR, 3, [The minor version of ObjFW])
dnl This may only be set to 1.3 once 1.3 is released
AC_SUBST(BUNDLE_VERSION, 1.2.0)
AC_SUBST(BUNDLE_SHORT_VERSION, 1.2)

for i in configure.ac build-aux/m4/*; do
	AS_IF([test $i -nt configure], [
		AC_MSG_ERROR([$i is newer than configure! Run ./autogen.sh!])
	])
done
|





|
<
|







1
2
3
4
5
6
7

8
9
10
11
12
13
14
15
AC_INIT(ObjFW, 1.2.1, js@nil.im, objfw, https://objfw.nil.im/)
AC_CONFIG_SRCDIR(src)
AC_CONFIG_AUX_DIR(build-aux)
AC_CONFIG_MACRO_DIR(build-aux/m4)

AC_DEFINE(OBJFW_VERSION_MAJOR, 1, [The major version of ObjFW])
AC_DEFINE(OBJFW_VERSION_MINOR, 2, [The minor version of ObjFW])

AC_SUBST(BUNDLE_VERSION, 1.2.1)
AC_SUBST(BUNDLE_SHORT_VERSION, 1.2)

for i in configure.ac build-aux/m4/*; do
	AS_IF([test $i -nt configure], [
		AC_MSG_ERROR([$i is newer than configure! Run ./autogen.sh!])
	])
done
234
235
236
237
238
239
240
241

242


243
244
245
246
247
248


249
250
251
252
253
254
255
	AS_IF([test x"$DEVKITPRO" = x""], [
		AC_MSG_ERROR([DEVKITPRO is not set! Please set DEVKITPRO.])
	])

	flags="-march=armv5te -mtune=arm946e-s -mthumb -mthumb-interwork"
	OBJCFLAGS="$OBJCFLAGS $flags"
	OBJFW_OBJCFLAGS="$OBJFW_OBJCFLAGS $flags"
	CPPFLAGS="$CPPFLAGS -DARM9 -I$DEVKITPRO/libnds/include"

	OBJFW_CPPFLAGS="$OBJFW_CPPFLAGS -DARM9 -I\$DEVKITPRO/libnds/include"


	ASFLAGS="$ASFLAGS -march=armv5te"
	LDFLAGS="$LDFLAGS -specs=ds_arm9.specs"
	OBJFW_LDFLAGS="$OBJFW_LDFLAGS -specs=ds_arm9.specs"
	tmp="-L$DEVKITPRO/libnds/lib -lfilesystem -lfat -lnds9"
	LIBS="$LIBS $tmp"
	OBJFW_LIBS="$OBJFW_LIBS $tmp"


	enable_shared="no"
	enable_threads="no"	# TODO
	enable_sockets="no"	# TODO
	check_pedantic="no"

	AC_DEFINE(OF_NINTENDO_DS, 1, [Whether we are compiling for Nintendo DS])
	AC_SUBST(USE_SRCS_NINTENDO_DS, '${SRCS_NINTENDO_DS}')







|
>
|
>
>

|
|
|
|
|
>
>







233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
	AS_IF([test x"$DEVKITPRO" = x""], [
		AC_MSG_ERROR([DEVKITPRO is not set! Please set DEVKITPRO.])
	])

	flags="-march=armv5te -mtune=arm946e-s -mthumb -mthumb-interwork"
	OBJCFLAGS="$OBJCFLAGS $flags"
	OBJFW_OBJCFLAGS="$OBJFW_OBJCFLAGS $flags"
	CPPFLAGS="$CPPFLAGS -DARM9 -D__NDS__ -I$DEVKITPRO/libnds/include"
	CPPFLAGS="$CPPFLAGS -I$DEVKITPRO/calico/include"
	OBJFW_CPPFLAGS="$OBJFW_CPPFLAGS -DARM9 -D__NDS__"
	OBJFW_CPPFLAGS="$OBJFW_CPPFLAGS -I\$DEVKITPRO/libnds/include"
	OBJFW_CPPFLAGS="$OBJFW_CPPFLAGS -I\$DEVKITPRO/calico/include"
	ASFLAGS="$ASFLAGS -march=armv5te"
	LDFLAGS="$LDFLAGS -specs=$DEVKITPRO/calico/share/ds9.specs"
	OBJFW_LDFLAGS="$OBJFW_LDFLAGS -specs=\$DEVKITPRO/calico/share/ds9.specs"
	LIBS="$LIBS -L$DEVKITPRO/libnds/lib -L$DEVKITPRO/calico/lib"
	LIBS="$LIBS -lfilesystem -lfat -lnds9 -lcalico_ds9"
	OBJFW_LIBS="$OBJFW_LIBS -L\$DEVKITPRO/libnds/lib"
	OBJFW_LIBS="$OBJFW_LIBS -L\$DEVKITPRO/calico/lib"
	OBJFW_LIBS="$OBJFW_LIBS -lfilesystem -lfat -lnds9 -lcalico_ds9"
	enable_shared="no"
	enable_threads="no"	# TODO
	enable_sockets="no"	# TODO
	check_pedantic="no"

	AC_DEFINE(OF_NINTENDO_DS, 1, [Whether we are compiling for Nintendo DS])
	AC_SUBST(USE_SRCS_NINTENDO_DS, '${SRCS_NINTENDO_DS}')
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
])

AS_IF([test x"$GOBJC" = x"yes"], [
	OBJCFLAGS="$OBJCFLAGS -Wwrite-strings -Wpointer-arith"

	AC_ARG_ENABLE(werror,
		AS_HELP_STRING([--disable-werror], [do not build with -Werror]))
	AS_IF([test x"$enable_werror" != x"no"], [
		OBJCFLAGS="$OBJCFLAGS -Werror"
	])

	old_OBJCFLAGS="$OBJCFLAGS"
	OBJCFLAGS="$OBJCFLAGS -Werror"
	AC_MSG_CHECKING(whether we need -Wno-strict-aliasing due to GCC bugs)
	AC_COMPILE_IFELSE([







|







2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
])

AS_IF([test x"$GOBJC" = x"yes"], [
	OBJCFLAGS="$OBJCFLAGS -Wwrite-strings -Wpointer-arith"

	AC_ARG_ENABLE(werror,
		AS_HELP_STRING([--disable-werror], [do not build with -Werror]))
	AS_IF([test x"$enable_werror" = x"yes"], [
		OBJCFLAGS="$OBJCFLAGS -Werror"
	])

	old_OBJCFLAGS="$OBJCFLAGS"
	OBJCFLAGS="$OBJCFLAGS -Werror"
	AC_MSG_CHECKING(whether we need -Wno-strict-aliasing due to GCC bugs)
	AC_COMPILE_IFELSE([

Modified extra.mk.in from [ee822dd682] to [dc906c47d1].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
OBJFW_SHARED_LIB = @OBJFW_SHARED_LIB@
OBJFW_STATIC_LIB = @OBJFW_STATIC_LIB@
OBJFW_FRAMEWORK = @OBJFW_FRAMEWORK@
OBJFW_LIB_MAJOR = 1
OBJFW_LIB_MINOR = 2
OBJFW_LIB_PATCH = 0
OBJFW_LIB_MAJOR_MINOR = ${OBJFW_LIB_MAJOR}.${OBJFW_LIB_MINOR}

OBJFWRT_SHARED_LIB = @OBJFWRT_SHARED_LIB@
OBJFWRT_STATIC_LIB = @OBJFWRT_STATIC_LIB@
OBJFWRT_FRAMEWORK = @OBJFWRT_FRAMEWORK@
OBJFWRT_LIB_MAJOR = 1
OBJFWRT_LIB_MINOR = 2
OBJFWRT_LIB_PATCH = 0
OBJFWRT_LIB_MAJOR_MINOR = ${OBJFWRT_LIB_MAJOR}.${OBJFWRT_LIB_MINOR}

OBJFWBRIDGE_SHARED_LIB = @OBJFWBRIDGE_SHARED_LIB@
OBJFWBRIDGE_STATIC_LIB = @OBJFWBRIDGE_STATIC_LIB@
OBJFWBRIDGE_FRAMEWORK = @OBJFWBRIDGE_FRAMEWORK@
OBJFWBRIDGE_LIB_MAJOR = 1
OBJFWBRIDGE_LIB_MINOR = 0





|







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
OBJFW_SHARED_LIB = @OBJFW_SHARED_LIB@
OBJFW_STATIC_LIB = @OBJFW_STATIC_LIB@
OBJFW_FRAMEWORK = @OBJFW_FRAMEWORK@
OBJFW_LIB_MAJOR = 1
OBJFW_LIB_MINOR = 2
OBJFW_LIB_PATCH = 1
OBJFW_LIB_MAJOR_MINOR = ${OBJFW_LIB_MAJOR}.${OBJFW_LIB_MINOR}

OBJFWRT_SHARED_LIB = @OBJFWRT_SHARED_LIB@
OBJFWRT_STATIC_LIB = @OBJFWRT_STATIC_LIB@
OBJFWRT_FRAMEWORK = @OBJFWRT_FRAMEWORK@
OBJFWRT_LIB_MAJOR = 1
OBJFWRT_LIB_MINOR = 2
OBJFWRT_LIB_PATCH = 1
OBJFWRT_LIB_MAJOR_MINOR = ${OBJFWRT_LIB_MAJOR}.${OBJFWRT_LIB_MINOR}

OBJFWBRIDGE_SHARED_LIB = @OBJFWBRIDGE_SHARED_LIB@
OBJFWBRIDGE_STATIC_LIB = @OBJFWBRIDGE_STATIC_LIB@
OBJFWBRIDGE_FRAMEWORK = @OBJFWBRIDGE_FRAMEWORK@
OBJFWBRIDGE_LIB_MAJOR = 1
OBJFWBRIDGE_LIB_MINOR = 0
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
OBJFWTLS_LIB_PATCH = 2

OBJFWHID_SHARED_LIB = @OBJFWHID_SHARED_LIB@
OBJFWHID_STATIC_LIB = @OBJFWHID_STATIC_LIB@
OBJFWHID_FRAMEWORK = @OBJFWHID_FRAMEWORK@
OBJFWHID_LIB_MAJOR = 1
OBJFWHID_LIB_MINOR = 0
OBJFWHID_LIB_PATCH = 0
OBJFWHID_LIB_MAJOR_MINOR = ${OBJFWHID_LIB_MAJOR}.${OBJFWHID_LIB_MINOR}

BIN_PREFIX = @BIN_PREFIX@
BRIDGE = @BRIDGE@
CVINCLUDE_INLINE_H = @CVINCLUDE_INLINE_H@
ENCODINGS_A = @ENCODINGS_A@
ENCODINGS_LIB_A = @ENCODINGS_LIB_A@







|







29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
OBJFWTLS_LIB_PATCH = 2

OBJFWHID_SHARED_LIB = @OBJFWHID_SHARED_LIB@
OBJFWHID_STATIC_LIB = @OBJFWHID_STATIC_LIB@
OBJFWHID_FRAMEWORK = @OBJFWHID_FRAMEWORK@
OBJFWHID_LIB_MAJOR = 1
OBJFWHID_LIB_MINOR = 0
OBJFWHID_LIB_PATCH = 1
OBJFWHID_LIB_MAJOR_MINOR = ${OBJFWHID_LIB_MAJOR}.${OBJFWHID_LIB_MINOR}

BIN_PREFIX = @BIN_PREFIX@
BRIDGE = @BRIDGE@
CVINCLUDE_INLINE_H = @CVINCLUDE_INLINE_H@
ENCODINGS_A = @ENCODINGS_A@
ENCODINGS_LIB_A = @ENCODINGS_LIB_A@

Modified src/OFApplication.m from [b5933f5ef1] to [30b931e27d].

497
498
499
500
501
502
503

504
505
506
507
508
509
510
511
	_argv = argv;

	encoding = [OFLocale encoding];

#ifndef OF_NINTENDO_DS
	if (*argc > 0) {
#else

	if (__system_argv->argvMagic == ARGV_MAGIC && __system_argv->argc > 0) {
#endif
		_programName = [[OFString alloc] initWithCString: (*argv)[0]
							encoding: encoding];
		arguments = [[OFMutableArray alloc] init];
		_arguments = arguments;

		for (int i = 1; i < *argc; i++)







>
|







497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
	_argv = argv;

	encoding = [OFLocale encoding];

#ifndef OF_NINTENDO_DS
	if (*argc > 0) {
#else
	if (g_envNdsArgvHeader->magic == ENV_NDS_ARGV_MAGIC &&
	    g_envNdsArgvHeader->argc > 0) {
#endif
		_programName = [[OFString alloc] initWithCString: (*argv)[0]
							encoding: encoding];
		arguments = [[OFMutableArray alloc] init];
		_arguments = arguments;

		for (int i = 1; i < *argc; i++)

Modified src/OFColor.h from [aeb31a556f] to [f08834ff4d].

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
 */
@interface OFColor: OFObject
#ifdef OF_HAVE_CLASS_PROPERTIES
@property (class, readonly, nonatomic) OFColor *black;
@property (class, readonly, nonatomic) OFColor *silver;
@property (class, readonly, nonatomic) OFColor *gray;
@property (class, readonly, nonatomic) OFColor *grey
    OF_DEPRECATED(ObjFW, 1, 1, "Use gray instead");
@property (class, readonly, nonatomic) OFColor *white;
@property (class, readonly, nonatomic) OFColor *maroon;
@property (class, readonly, nonatomic) OFColor *red;
@property (class, readonly, nonatomic) OFColor *purple;
@property (class, readonly, nonatomic) OFColor *fuchsia;
@property (class, readonly, nonatomic) OFColor *green;
@property (class, readonly, nonatomic) OFColor *lime;







|







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
 */
@interface OFColor: OFObject
#ifdef OF_HAVE_CLASS_PROPERTIES
@property (class, readonly, nonatomic) OFColor *black;
@property (class, readonly, nonatomic) OFColor *silver;
@property (class, readonly, nonatomic) OFColor *gray;
@property (class, readonly, nonatomic) OFColor *grey
    OF_DEPRECATED(ObjFW, 1, 1, "Use +[gray] instead");
@property (class, readonly, nonatomic) OFColor *white;
@property (class, readonly, nonatomic) OFColor *maroon;
@property (class, readonly, nonatomic) OFColor *red;
@property (class, readonly, nonatomic) OFColor *purple;
@property (class, readonly, nonatomic) OFColor *fuchsia;
@property (class, readonly, nonatomic) OFColor *green;
@property (class, readonly, nonatomic) OFColor *lime;
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
 *
 * @deprecated Use @ref gray instead.
 *
 * The RGBA value is (0.5, 0.5, 0.5, 1).
 *
 * @return The HTML color `gray`
 */
+ (OFColor *)grey OF_DEPRECATED(ObjFW, 1, 1, "Use gray instead");

/**
 * @brief Returns the HTML color `white`.
 *
 * The RGBA value is (1, 1, 1, 1).
 *
 * @return The HTML color `white`







|







95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
 *
 * @deprecated Use @ref gray instead.
 *
 * The RGBA value is (0.5, 0.5, 0.5, 1).
 *
 * @return The HTML color `gray`
 */
+ (OFColor *)grey OF_DEPRECATED(ObjFW, 1, 1, "Use +[gray] instead");

/**
 * @brief Returns the HTML color `white`.
 *
 * The RGBA value is (1, 1, 1, 1).
 *
 * @return The HTML color `white`

Modified src/OFFileIRIHandler.m from [3b38bf74b9] to [9e20f4f6f5].

39
40
41
42
43
44
45

46
47
48
49
50
51
52
#if defined(OF_LINUX) || defined(OF_MACOS)
# include <sys/xattr.h>
#endif
#if defined(OF_FREEBSD) || defined(OF_NETBSD)
# include <sys/extattr.h>
#endif
#ifdef OF_HAIKU

# include <kernel/fs_attr.h>
#endif
#ifdef OF_DJGPP
# include <syslimits.h>
#endif

#ifdef HAVE_FCNTL_H







>







39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#if defined(OF_LINUX) || defined(OF_MACOS)
# include <sys/xattr.h>
#endif
#if defined(OF_FREEBSD) || defined(OF_NETBSD)
# include <sys/extattr.h>
#endif
#ifdef OF_HAIKU
# include <TypeConstants.h>
# include <kernel/fs_attr.h>
#endif
#ifdef OF_DJGPP
# include <syslimits.h>
#endif

#ifdef HAVE_FCNTL_H

Modified src/OFINISection.m from [1775218a4e] to [f5a74f6cad].

106
107
108
109
110
111
112
113
114
115
116
117
118
119
120

+ (void)initialize
{
	if (self != [OFINISection class])
		return;

	needsEscapeCharacterSet = [[OFCharacterSet alloc]
	    initWithCharactersInString: @"\r\n\f\"\\="];
}

- (instancetype)of_initWithName: (OFString *)name OF_DIRECT
{
	self = [super init];

	@try {







|







106
107
108
109
110
111
112
113
114
115
116
117
118
119
120

+ (void)initialize
{
	if (self != [OFINISection class])
		return;

	needsEscapeCharacterSet = [[OFCharacterSet alloc]
	    initWithCharactersInString: @"\r\n\f\"\\=;#"];
}

- (instancetype)of_initWithName: (OFString *)name OF_DIRECT
{
	self = [super init];

	@try {

Modified src/hid/OHDualSenseGamepad+Private.h from [c709fabb29] to [8da9d08239].

25
26
27
28
29
30
31
32
33
34
35

OF_ASSUME_NONNULL_BEGIN

@interface OHDualSenseGamepad ()
#if defined(OF_LINUX) && defined(OF_HAVE_FILES)
    <OHEvdevMapping>
#endif
- (instancetype)oh_init OF_METHOD_FAMILY(init) OF_DESIGNATED_INITIALIZER;
@end

OF_ASSUME_NONNULL_END







|



25
26
27
28
29
30
31
32
33
34
35

OF_ASSUME_NONNULL_BEGIN

@interface OHDualSenseGamepad ()
#if defined(OF_LINUX) && defined(OF_HAVE_FILES)
    <OHEvdevMapping>
#endif
- (instancetype)oh_init OF_METHOD_FAMILY(init);
@end

OF_ASSUME_NONNULL_END

Modified src/hid/OHDualShock4Gamepad+Private.h from [7cd9cfca62] to [256690777c].

25
26
27
28
29
30
31
32
33
34
35

OF_ASSUME_NONNULL_BEGIN

@interface OHDualShock4Gamepad ()
#if defined(OF_LINUX) && defined(OF_HAVE_FILES)
    <OHEvdevMapping>
#endif
- (instancetype)oh_init OF_METHOD_FAMILY(init) OF_DESIGNATED_INITIALIZER;
@end

OF_ASSUME_NONNULL_END







|



25
26
27
28
29
30
31
32
33
34
35

OF_ASSUME_NONNULL_BEGIN

@interface OHDualShock4Gamepad ()
#if defined(OF_LINUX) && defined(OF_HAVE_FILES)
    <OHEvdevMapping>
#endif
- (instancetype)oh_init OF_METHOD_FAMILY(init);
@end

OF_ASSUME_NONNULL_END

Modified src/hid/OHEmulatedGameControllerAxis.h from [3afaf898c0] to [e3a5449d20].

30
31
32
33
34
35
36
37
38
39
40
}

- (instancetype)oh_initWithName: (OFString *)name
			 analog: (bool)analog OF_UNAVAILABLE;
- (instancetype)
    oh_initWithNegativeButton: (OHGameControllerButton *)negativeButton
	       positiveButton: (OHGameControllerButton *)positiveButton
    OF_METHOD_FAMILY(init) OF_DESIGNATED_INITIALIZER;
@end

OF_ASSUME_NONNULL_END







|



30
31
32
33
34
35
36
37
38
39
40
}

- (instancetype)oh_initWithName: (OFString *)name
			 analog: (bool)analog OF_UNAVAILABLE;
- (instancetype)
    oh_initWithNegativeButton: (OHGameControllerButton *)negativeButton
	       positiveButton: (OHGameControllerButton *)positiveButton
    OF_METHOD_FAMILY(init);
@end

OF_ASSUME_NONNULL_END

Modified src/hid/OHEmulatedGameControllerButton.h from [134791865d] to [77b7fd89b8].

29
30
31
32
33
34
35
36
37
38
39
40
	OHGameControllerAxis *_axis;
	bool _positive;
}

- (instancetype)oh_initWithName: (OFString *)name
			 analog: (bool)analog OF_UNAVAILABLE;
- (instancetype)oh_initWithAxis: (OHGameControllerAxis *)axis
		       positive: (bool)positive
    OF_METHOD_FAMILY(init) OF_DESIGNATED_INITIALIZER;
@end

OF_ASSUME_NONNULL_END







|
<



29
30
31
32
33
34
35
36

37
38
39
	OHGameControllerAxis *_axis;
	bool _positive;
}

- (instancetype)oh_initWithName: (OFString *)name
			 analog: (bool)analog OF_UNAVAILABLE;
- (instancetype)oh_initWithAxis: (OHGameControllerAxis *)axis
		       positive: (bool)positive OF_METHOD_FAMILY(init);

@end

OF_ASSUME_NONNULL_END

Modified src/hid/OHEmulatedGameControllerTriggerButton.h from [f7bd66afbb] to [f8a3eeb7a5].

35
36
37
38
39
40
41
42
43
44
45
			   analog: (bool)analog OF_UNAVAILABLE;
+ (instancetype)oh_buttonWithName: (OFString *)name
			     axis: (OHGameControllerAxis *)axis;
- (instancetype)oh_initWithName: (OFString *)name
			 analog: (bool)analog OF_UNAVAILABLE;
- (instancetype)oh_initWithName: (OFString *)name
			   axis: (OHGameControllerAxis *)axis
    OF_METHOD_FAMILY(init) OF_DESIGNATED_INITIALIZER;
@end

OF_ASSUME_NONNULL_END







|



35
36
37
38
39
40
41
42
43
44
45
			   analog: (bool)analog OF_UNAVAILABLE;
+ (instancetype)oh_buttonWithName: (OFString *)name
			     axis: (OHGameControllerAxis *)axis;
- (instancetype)oh_initWithName: (OFString *)name
			 analog: (bool)analog OF_UNAVAILABLE;
- (instancetype)oh_initWithName: (OFString *)name
			   axis: (OHGameControllerAxis *)axis
    OF_METHOD_FAMILY(init);
@end

OF_ASSUME_NONNULL_END

Modified src/hid/OHEvdevGameController.h from [0a1d016c47] to [813d4bc347].

35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
	unsigned long *_evBits, *_keyBits, *_absBits;
	uint16_t _vendorID, _productID;
	OFString *_name;
	id <OHGameControllerProfile, OHEvdevMapping> _profile;
}

- (instancetype)oh_init OF_UNAVAILABLE;
- (instancetype)oh_initWithPath: (OFString *)path
    OF_METHOD_FAMILY(init) OF_DESIGNATED_INITIALIZER;
- (void)oh_pollState;
@end

extern const uint16_t OHEvdevButtonIDs[];
extern const size_t OHNumEvdevButtonIDs;
extern const uint16_t OHEvdevAxisIDs[];
extern const size_t OHNumEvdevAxisIDs;







|
<







35
36
37
38
39
40
41
42

43
44
45
46
47
48
49
	unsigned long *_evBits, *_keyBits, *_absBits;
	uint16_t _vendorID, _productID;
	OFString *_name;
	id <OHGameControllerProfile, OHEvdevMapping> _profile;
}

- (instancetype)oh_init OF_UNAVAILABLE;
- (instancetype)oh_initWithPath: (OFString *)path OF_METHOD_FAMILY(init);

- (void)oh_pollState;
@end

extern const uint16_t OHEvdevButtonIDs[];
extern const size_t OHNumEvdevButtonIDs;
extern const uint16_t OHEvdevAxisIDs[];
extern const size_t OHNumEvdevAxisIDs;

Modified src/hid/OHEvdevGameControllerProfile.h from [a2fd1c2755] to [ed547560b4].

33
34
35
36
37
38
39
40
41
42
43
44

- (instancetype)init OF_UNAVAILABLE;

- (instancetype)oh_initWithKeyBits: (unsigned long *)keyBits
			    evBits: (unsigned long *)evBits
			   absBits: (unsigned long *)absBits
			  vendorID: (uint16_t)vendorID
			 productID: (uint16_t)productID
    OF_METHOD_FAMILY(init) OF_DESIGNATED_INITIALIZER;
@end

OF_ASSUME_NONNULL_END







|
<



33
34
35
36
37
38
39
40

41
42
43

- (instancetype)init OF_UNAVAILABLE;

- (instancetype)oh_initWithKeyBits: (unsigned long *)keyBits
			    evBits: (unsigned long *)evBits
			   absBits: (unsigned long *)absBits
			  vendorID: (uint16_t)vendorID
			 productID: (uint16_t)productID OF_METHOD_FAMILY(init);

@end

OF_ASSUME_NONNULL_END

Modified src/hid/OHGameController+Private.h from [fcf1771c7f] to [b67100c46a].

18
19
20
21
22
23
24
25
26
27
28
 */

#import "OHGameController.h"

OF_ASSUME_NONNULL_BEGIN

@interface OHGameController ()
- (instancetype)oh_init OF_METHOD_FAMILY(init) OF_DESIGNATED_INITIALIZER;
@end

OF_ASSUME_NONNULL_END







|



18
19
20
21
22
23
24
25
26
27
28
 */

#import "OHGameController.h"

OF_ASSUME_NONNULL_BEGIN

@interface OHGameController ()
- (instancetype)oh_init OF_METHOD_FAMILY(init);
@end

OF_ASSUME_NONNULL_END

Modified src/hid/OHGameControllerElement+Private.h from [71db15a22e] to [dec44682d8].

20
21
22
23
24
25
26
27
28
29
30
31
#import "OHGameControllerElement.h"

OF_ASSUME_NONNULL_BEGIN

@interface OHGameControllerElement ()
+ (instancetype)oh_elementWithName: (OFString *)name analog: (bool)analog;
- (instancetype)oh_initWithName: (OFString *)name
			 analog: (bool)analog
    OF_METHOD_FAMILY(init) OF_DESIGNATED_INITIALIZER;
@end

OF_ASSUME_NONNULL_END







|
<



20
21
22
23
24
25
26
27

28
29
30
#import "OHGameControllerElement.h"

OF_ASSUME_NONNULL_BEGIN

@interface OHGameControllerElement ()
+ (instancetype)oh_elementWithName: (OFString *)name analog: (bool)analog;
- (instancetype)oh_initWithName: (OFString *)name
			 analog: (bool)analog OF_METHOD_FAMILY(init);

@end

OF_ASSUME_NONNULL_END

Modified src/hid/OHJoyConPair.h from [5a32c92419] to [343333c252].

59
60
61
62
63
64
65
66
67
68
69
70
 *	  and right Joy-Con.
 *
 * @param leftJoyCon The left Joy-Con for the pair
 * @param rightJoyCon The right Joy-Con for the pair
 * @return An initialized Joy-Con pair
 */
- (instancetype)initWithLeftJoyCon: (OHLeftJoyCon *)leftJoyCon
		       rightJoyCon: (OHRightJoyCon *)rightJoyCon
    OF_DESIGNATED_INITIALIZER;
@end

OF_ASSUME_NONNULL_END







|
<



59
60
61
62
63
64
65
66

67
68
69
 *	  and right Joy-Con.
 *
 * @param leftJoyCon The left Joy-Con for the pair
 * @param rightJoyCon The right Joy-Con for the pair
 * @return An initialized Joy-Con pair
 */
- (instancetype)initWithLeftJoyCon: (OHLeftJoyCon *)leftJoyCon
		       rightJoyCon: (OHRightJoyCon *)rightJoyCon;

@end

OF_ASSUME_NONNULL_END

Modified src/hid/OHLeftJoyCon+Private.h from [64c33a2717] to [d9cae2ad1e].

25
26
27
28
29
30
31
32
33
34
35

OF_ASSUME_NONNULL_BEGIN

@interface OHLeftJoyCon ()
#if defined(OF_LINUX) && defined(OF_HAVE_FILES)
    <OHEvdevMapping>
#endif
- (instancetype)oh_init OF_METHOD_FAMILY(init) OF_DESIGNATED_INITIALIZER;
@end

OF_ASSUME_NONNULL_END







|



25
26
27
28
29
30
31
32
33
34
35

OF_ASSUME_NONNULL_BEGIN

@interface OHLeftJoyCon ()
#if defined(OF_LINUX) && defined(OF_HAVE_FILES)
    <OHEvdevMapping>
#endif
- (instancetype)oh_init OF_METHOD_FAMILY(init);
@end

OF_ASSUME_NONNULL_END

Modified src/hid/OHN64Controller+Private.h from [11c03bea55] to [3cccc797b8].

25
26
27
28
29
30
31
32
33
34
35

OF_ASSUME_NONNULL_BEGIN

@interface OHN64Controller ()
#if defined(OF_LINUX) && defined(OF_HAVE_FILES)
    <OHEvdevMapping>
#endif
- (instancetype)oh_init OF_METHOD_FAMILY(init) OF_DESIGNATED_INITIALIZER;
@end

OF_ASSUME_NONNULL_END







|



25
26
27
28
29
30
31
32
33
34
35

OF_ASSUME_NONNULL_BEGIN

@interface OHN64Controller ()
#if defined(OF_LINUX) && defined(OF_HAVE_FILES)
    <OHEvdevMapping>
#endif
- (instancetype)oh_init OF_METHOD_FAMILY(init);
@end

OF_ASSUME_NONNULL_END

Modified src/hid/OHNintendo3DSExtendedGamepad+Private.h from [71e1e47b25] to [9b50f77fa0].

18
19
20
21
22
23
24
25
26
27
28
 */

#import "OHNintendo3DSExtendedGamepad.h"

OF_ASSUME_NONNULL_BEGIN

@interface OHNintendo3DSExtendedGamepad ()
- (instancetype)oh_init OF_METHOD_FAMILY(init) OF_DESIGNATED_INITIALIZER;
@end

OF_ASSUME_NONNULL_END







|



18
19
20
21
22
23
24
25
26
27
28
 */

#import "OHNintendo3DSExtendedGamepad.h"

OF_ASSUME_NONNULL_BEGIN

@interface OHNintendo3DSExtendedGamepad ()
- (instancetype)oh_init OF_METHOD_FAMILY(init);
@end

OF_ASSUME_NONNULL_END

Modified src/hid/OHNintendoDSGamepad+Private.h from [cd863ff816] to [a910f4b610].

18
19
20
21
22
23
24
25
26
27
28
 */

#import "OHNintendoDSGamepad.h"

OF_ASSUME_NONNULL_BEGIN

@interface OHNintendoDSGamepad ()
- (instancetype)oh_init OF_METHOD_FAMILY(init) OF_DESIGNATED_INITIALIZER;
@end

OF_ASSUME_NONNULL_END







|



18
19
20
21
22
23
24
25
26
27
28
 */

#import "OHNintendoDSGamepad.h"

OF_ASSUME_NONNULL_BEGIN

@interface OHNintendoDSGamepad ()
- (instancetype)oh_init OF_METHOD_FAMILY(init);
@end

OF_ASSUME_NONNULL_END

Modified src/hid/OHNintendoSwitchExtendedGamepad+Private.h from [f2f071698a] to [be43e5e2ac].

18
19
20
21
22
23
24
25
26
27
28
 */

#import "OHNintendoSwitchExtendedGamepad.h"

OF_ASSUME_NONNULL_BEGIN

@interface OHNintendoSwitchExtendedGamepad ()
- (instancetype)oh_init OF_METHOD_FAMILY(init) OF_DESIGNATED_INITIALIZER;
@end

OF_ASSUME_NONNULL_END







|



18
19
20
21
22
23
24
25
26
27
28
 */

#import "OHNintendoSwitchExtendedGamepad.h"

OF_ASSUME_NONNULL_BEGIN

@interface OHNintendoSwitchExtendedGamepad ()
- (instancetype)oh_init OF_METHOD_FAMILY(init);
@end

OF_ASSUME_NONNULL_END

Modified src/hid/OHNintendoSwitchGameController.h from [1610daa529] to [51074ab4e9].

30
31
32
33
34
35
36
37
38
39
40
41
@interface OHNintendoSwitchGameController: OHGameController
{
	PadState _pad;
	OHNintendoSwitchExtendedGamepad *_extendedGamepad;
}

- (instancetype)oh_init OF_UNAVAILABLE;
- (instancetype)oh_initWithIndex: (size_t)index
    OF_METHOD_FAMILY(init) OF_DESIGNATED_INITIALIZER;
@end

OF_ASSUME_NONNULL_END







|
<



30
31
32
33
34
35
36
37

38
39
40
@interface OHNintendoSwitchGameController: OHGameController
{
	PadState _pad;
	OHNintendoSwitchExtendedGamepad *_extendedGamepad;
}

- (instancetype)oh_init OF_UNAVAILABLE;
- (instancetype)oh_initWithIndex: (size_t)index OF_METHOD_FAMILY(init);

@end

OF_ASSUME_NONNULL_END

Modified src/hid/OHRightJoyCon+Private.h from [802121ee0a] to [b6e6a9e110].

25
26
27
28
29
30
31
32
33
34
35

OF_ASSUME_NONNULL_BEGIN

@interface OHRightJoyCon ()
#if defined(OF_LINUX) && defined(OF_HAVE_FILES)
    <OHEvdevMapping>
#endif
- (instancetype)oh_init OF_METHOD_FAMILY(init) OF_DESIGNATED_INITIALIZER;
@end

OF_ASSUME_NONNULL_END







|



25
26
27
28
29
30
31
32
33
34
35

OF_ASSUME_NONNULL_BEGIN

@interface OHRightJoyCon ()
#if defined(OF_LINUX) && defined(OF_HAVE_FILES)
    <OHEvdevMapping>
#endif
- (instancetype)oh_init OF_METHOD_FAMILY(init);
@end

OF_ASSUME_NONNULL_END

Modified src/hid/OHStadiaGamepad+Private.h from [a442bf59a0] to [261dc06b71].

25
26
27
28
29
30
31
32
33
34
35

OF_ASSUME_NONNULL_BEGIN

@interface OHStadiaGamepad ()
#if defined(OF_LINUX) && defined(OF_HAVE_FILES)
    <OHEvdevMapping>
#endif
- (instancetype)oh_init OF_METHOD_FAMILY(init) OF_DESIGNATED_INITIALIZER;
@end

OF_ASSUME_NONNULL_END







|



25
26
27
28
29
30
31
32
33
34
35

OF_ASSUME_NONNULL_BEGIN

@interface OHStadiaGamepad ()
#if defined(OF_LINUX) && defined(OF_HAVE_FILES)
    <OHEvdevMapping>
#endif
- (instancetype)oh_init OF_METHOD_FAMILY(init);
@end

OF_ASSUME_NONNULL_END

Modified src/hid/OHWiiClassicController+Private.h from [349a2e57f0] to [0b66b4db5f].

18
19
20
21
22
23
24
25
26
27
28
 */

#import "OHWiiClassicController.h"

OF_ASSUME_NONNULL_BEGIN

@interface OHWiiClassicController ()
- (instancetype)oh_init OF_METHOD_FAMILY(init) OF_DESIGNATED_INITIALIZER;
@end

OF_ASSUME_NONNULL_END







|



18
19
20
21
22
23
24
25
26
27
28
 */

#import "OHWiiClassicController.h"

OF_ASSUME_NONNULL_BEGIN

@interface OHWiiClassicController ()
- (instancetype)oh_init OF_METHOD_FAMILY(init);
@end

OF_ASSUME_NONNULL_END

Modified src/hid/OHWiiGameController.h from [8f82a3a691] to [be7752eb1d].

26
27
28
29
30
31
32
33
34
35
36
37
	int32_t _index;
	uint32_t _type;
	id <OHGameControllerProfile> _profile;
}

- (instancetype)oh_init OF_UNAVAILABLE;
- (instancetype)oh_initWithIndex: (int32_t)index
			    type: (uint32_t)type
    OF_METHOD_FAMILY(init) OF_DESIGNATED_INITIALIZER;
@end

OF_ASSUME_NONNULL_END







|
<



26
27
28
29
30
31
32
33

34
35
36
	int32_t _index;
	uint32_t _type;
	id <OHGameControllerProfile> _profile;
}

- (instancetype)oh_init OF_UNAVAILABLE;
- (instancetype)oh_initWithIndex: (int32_t)index
			    type: (uint32_t)type OF_METHOD_FAMILY(init);

@end

OF_ASSUME_NONNULL_END

Modified src/hid/OHWiimote+Private.h from [2b1ff9eae2] to [3543c7fa16].

18
19
20
21
22
23
24
25
26
27
28
 */

#import "OHWiimote.h"

OF_ASSUME_NONNULL_BEGIN

@interface OHWiimote ()
- (instancetype)oh_init OF_METHOD_FAMILY(init) OF_DESIGNATED_INITIALIZER;
@end

OF_ASSUME_NONNULL_END







|



18
19
20
21
22
23
24
25
26
27
28
 */

#import "OHWiimote.h"

OF_ASSUME_NONNULL_BEGIN

@interface OHWiimote ()
- (instancetype)oh_init OF_METHOD_FAMILY(init);
@end

OF_ASSUME_NONNULL_END

Modified src/hid/OHXInputGameController.h from [6ebbc4a0ee] to [6b657e156e].

29
30
31
32
33
34
35
36
37
38
39
40
{
	DWORD _index;
	OFNumber *_Nullable _vendorID, *_Nullable _productID;
	OHXboxGamepad *_extendedGamepad;
}

- (instancetype)oh_init OF_UNAVAILABLE;
- (instancetype)oh_initWithIndex: (DWORD)index
    OF_METHOD_FAMILY(init) OF_DESIGNATED_INITIALIZER;
@end

OF_ASSUME_NONNULL_END







|
<



29
30
31
32
33
34
35
36

37
38
39
{
	DWORD _index;
	OFNumber *_Nullable _vendorID, *_Nullable _productID;
	OHXboxGamepad *_extendedGamepad;
}

- (instancetype)oh_init OF_UNAVAILABLE;
- (instancetype)oh_initWithIndex: (DWORD)index OF_METHOD_FAMILY(init);

@end

OF_ASSUME_NONNULL_END

Modified src/hid/OHXboxGamepad+Private.h from [d4ee9c13d5] to [f5059777cd].

19
20
21
22
23
24
25
26
27
28
29

#import "OHXboxGamepad.h"

OF_ASSUME_NONNULL_BEGIN

@interface OHXboxGamepad ()
- (instancetype)oh_initWithHasGuideButton: (bool)hasGuideButton
    OF_METHOD_FAMILY(init) OF_DESIGNATED_INITIALIZER;
@end

OF_ASSUME_NONNULL_END







|



19
20
21
22
23
24
25
26
27
28
29

#import "OHXboxGamepad.h"

OF_ASSUME_NONNULL_BEGIN

@interface OHXboxGamepad ()
- (instancetype)oh_initWithHasGuideButton: (bool)hasGuideButton
    OF_METHOD_FAMILY(init);
@end

OF_ASSUME_NONNULL_END

Modified src/runtime/exception.m from [7f6288ce90] to [0a89e50a33].

35
36
37
38
39
40
41

42
43
44
45
46
47
48

#ifdef __SEH__
# include <windows.h>
#endif

#if defined(__SEH__)
# define PERSONALITY gnu_objc_personality

#elif defined(__USING_SJLJ_EXCEPTIONS__)
# define PERSONALITY __gnu_objc_personality_sj0
# define CXX_PERSONALITY_STR "__gxx_personality_sj0"
# define _Unwind_RaiseException _Unwind_SjLj_RaiseException
# define __builtin_eh_return_data_regno(i) (i)
#else
# define PERSONALITY __gnu_objc_personality_v0







>







35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

#ifdef __SEH__
# include <windows.h>
#endif

#if defined(__SEH__)
# define PERSONALITY gnu_objc_personality
# define CXX_PERSONALITY_STR "__gxx_personality_seh0"
#elif defined(__USING_SJLJ_EXCEPTIONS__)
# define PERSONALITY __gnu_objc_personality_sj0
# define CXX_PERSONALITY_STR "__gxx_personality_sj0"
# define _Unwind_RaiseException _Unwind_SjLj_RaiseException
# define __builtin_eh_return_data_regno(i) (i)
#else
# define PERSONALITY __gnu_objc_personality_v0
233
234
235
236
237
238
239



























240
241
242
243
244
245
246
247
_Unwind_SetIP(struct _Unwind_Context *ctx, uintptr_t value)
{
	uintptr_t thumb = _Unwind_GetGR(ctx, 15) & 1;
	_Unwind_SetGR(ctx, 15, (value | thumb));
}
#endif




























#if defined(CXX_PERSONALITY_STR) && !defined(OF_AMIGAOS_M68K)
static PERSONALITY_FUNC(cxx_personality) OF_WEAK_REF(CXX_PERSONALITY_STR);
#endif

#ifdef __SEH__
extern EXCEPTION_DISPOSITION _GCC_specific_handler(PEXCEPTION_RECORD, void *,
    PCONTEXT, PDISPATCHER_CONTEXT, _Unwind_Reason_Code (*)(int, int, uint64_t,
    struct _Unwind_Exception *, struct _Unwind_Context *));







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|







234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
_Unwind_SetIP(struct _Unwind_Context *ctx, uintptr_t value)
{
	uintptr_t thumb = _Unwind_GetGR(ctx, 15) & 1;
	_Unwind_SetGR(ctx, 15, (value | thumb));
}
#endif

#if defined(OF_WINDOWS)
# ifdef __SEH__
static EXCEPTION_DISPOSITION (*cxx_personality)(PEXCEPTION_RECORD, void *,
    PCONTEXT, PDISPATCHER_CONTEXT);
# else
static PERSONALITY_FUNC((*cxx_personality));
# endif

OF_CONSTRUCTOR()
{
	/*
	 * This only works if the application uses libc++.dll or
	 * libstdc++-6.dll. There is unfortunately no other way, as Windows
	 * does not support proper weak linking.
	 */

	HMODULE module;

	module = GetModuleHandle("libc++");

	if (module == NULL)
		module = GetModuleHandle("libstdc++-6");

	if (module != NULL)
		cxx_personality = (__typeof__(cxx_personality))
		    GetProcAddress(module, CXX_PERSONALITY_STR);
}
#elif !defined(OF_AMIGAOS_M68K)
static PERSONALITY_FUNC(cxx_personality) OF_WEAK_REF(CXX_PERSONALITY_STR);
#endif

#ifdef __SEH__
extern EXCEPTION_DISPOSITION _GCC_specific_handler(PEXCEPTION_RECORD, void *,
    PCONTEXT, PDISPATCHER_CONTEXT, _Unwind_Reason_Code (*)(int, int, uint64_t,
    struct _Unwind_Exception *, struct _Unwind_Context *));
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
	struct LSDA LSDA;
	uintptr_t landingpad = 0;
	uint8_t found = 0;
	intptr_t filter = 0;

	if (foreign) {
		switch (exClass) {
#if defined(CXX_PERSONALITY_STR) && !defined(OF_AMIGAOS_M68K)
		case GNUCCXX0_EXCEPTION_CLASS:
		case CLNGCXX0_EXCEPTION_CLASS:
			if (cxx_personality != NULL)
				return CALL_PERSONALITY(cxx_personality);
			break;
#endif
		}







|







639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
	struct LSDA LSDA;
	uintptr_t landingpad = 0;
	uint8_t found = 0;
	intptr_t filter = 0;

	if (foreign) {
		switch (exClass) {
#if !defined(__SEH__) && !defined(OF_AMIGAOS_M68K)
		case GNUCCXX0_EXCEPTION_CLASS:
		case CLNGCXX0_EXCEPTION_CLASS:
			if (cxx_personality != NULL)
				return CALL_PERSONALITY(cxx_personality);
			break;
#endif
		}
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
	objc_uncaught_exception_handler old = uncaughtExceptionHandler;
	uncaughtExceptionHandler = handler;

	return old;
}

#ifdef __SEH__
typedef EXCEPTION_DISPOSITION (*seh_personality_fn)(PEXCEPTION_RECORD, void *,
    PCONTEXT, PDISPATCHER_CONTEXT);
static seh_personality_fn __gxx_personality_seh0;

OF_CONSTRUCTOR()
{
	/*
	 * This only works if the application uses libstdc++-6.dll.
	 * There is unfortunately no other way, as Windows does not support
	 * proper weak linking.
	 */

	HMODULE module;
	if ((module = GetModuleHandle("libstdc++-6")) == NULL)
		return;

	__gxx_personality_seh0 = (seh_personality_fn)
	    GetProcAddress(module, "__gxx_personality_seh0");
}

EXCEPTION_DISPOSITION
__gnu_objc_personality_seh0(PEXCEPTION_RECORD ms_exc, void *this_frame,
    PCONTEXT ms_orig_context, PDISPATCHER_CONTEXT ms_disp)
{
	struct _Unwind_Exception *ex =
	    (struct _Unwind_Exception *)ms_exc->ExceptionInformation[0];

	switch (ex->class) {
	case GNUCCXX0_EXCEPTION_CLASS:
	case CLNGCXX0_EXCEPTION_CLASS:
		if (__gxx_personality_seh0 != NULL)
			return __gxx_personality_seh0(ms_exc, this_frame,
			    ms_orig_context, ms_disp);
	}

	return _GCC_specific_handler(ms_exc, this_frame, ms_orig_context,
	    ms_disp, PERSONALITY);
}
#endif







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<










|
|







809
810
811
812
813
814
815




















816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
	objc_uncaught_exception_handler old = uncaughtExceptionHandler;
	uncaughtExceptionHandler = handler;

	return old;
}

#ifdef __SEH__




















EXCEPTION_DISPOSITION
__gnu_objc_personality_seh0(PEXCEPTION_RECORD ms_exc, void *this_frame,
    PCONTEXT ms_orig_context, PDISPATCHER_CONTEXT ms_disp)
{
	struct _Unwind_Exception *ex =
	    (struct _Unwind_Exception *)ms_exc->ExceptionInformation[0];

	switch (ex->class) {
	case GNUCCXX0_EXCEPTION_CLASS:
	case CLNGCXX0_EXCEPTION_CLASS:
		if (cxx_personality != NULL)
			return cxx_personality(ms_exc, this_frame,
			    ms_orig_context, ms_disp);
	}

	return _GCC_specific_handler(ms_exc, this_frame, ms_orig_context,
	    ms_disp, PERSONALITY);
}
#endif

Modified src/tls/OFOpenSSLTLSStream.m from [ca917e4347] to [4fc8bd4998].

88
89
90
91
92
93
94
95
96










97
98
99
100
101
102
103
}

- (void)close
{
	if (_SSL == NULL)
		@throw [OFNotOpenException exceptionWithObject: self];

	if (_handshakeDone)
		SSL_shutdown(_SSL);











	SSL_free(_SSL);
	_SSL = NULL;

	_handshakeDone = false;

	[_host release];







|

>
>
>
>
>
>
>
>
>
>







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
}

- (void)close
{
	if (_SSL == NULL)
		@throw [OFNotOpenException exceptionWithObject: self];

	if (_handshakeDone) {
		SSL_shutdown(_SSL);

		while (BIO_ctrl_pending(_writeBIO) > 0) {
			int tmp = BIO_read(_writeBIO, _buffer, bufferSize);

			OFEnsure(tmp >= 0);

			[_underlyingStream writeBuffer: _buffer length: tmp];
			[_underlyingStream flushWriteBuffer];
		}
	}

	SSL_free(_SSL);
	_SSL = NULL;

	_handshakeDone = false;

	[_host release];

Modified src/tls/ObjFWTLS.h from [ee1b068c51] to [6afd5015ee].

13
14
15
16
17
18
19

20







21
22
23
24
25
26
27
 * version 3.0 for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3.0 along with this program. If not, see
 * <https://www.gnu.org/licenses/>.
 */


#import "macros.h"








#ifdef __cplusplus
extern "C" {
#endif
extern int _ObjFWTLS_reference;
#ifdef __cplusplus
}







>
|
>
>
>
>
>
>
>







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
 * version 3.0 for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3.0 along with this program. If not, see
 * <https://www.gnu.org/licenses/>.
 */

#ifdef OBJFWTLS_LOCAL_INCLUDES
# import "macros.h"
#else
# if defined(__has_feature) && __has_feature(modules)
@import ObjFW;
# else
#  import <ObjFW/macros.h>
# endif
#endif

#ifdef __cplusplus
extern "C" {
#endif
extern int _ObjFWTLS_reference;
#ifdef __cplusplus
}

Modified tests/Makefile from [895a4be7e6] to [e726c1ead4].

244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
${PROG_NOINST}.arm9: ${PROG_NOINST}
	arm-none-eabi-objcopy -O binary $< $@

${PROG_NOINST}.nds: ${PROG_NOINST}.arm9 testfile.txt
	rm -fr nds-data
	mkdir -p nds-data
	cp testfile.txt nds-data
	ndstool -c $@ -9 ${PROG_NOINST} -d nds-data
	rm -fr nds-data

${PROG_NOINST}.nro: ${PROG_NOINST} testfile.txt
	rm -fr romfs
	mkdir -p romfs
	cp testfile.txt romfs
	nacptool --create "ObjFW tests" "Jonathan Schleifer" \







|







244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
${PROG_NOINST}.arm9: ${PROG_NOINST}
	arm-none-eabi-objcopy -O binary $< $@

${PROG_NOINST}.nds: ${PROG_NOINST}.arm9 testfile.txt
	rm -fr nds-data
	mkdir -p nds-data
	cp testfile.txt nds-data
	ndstool -c $@ -7 ${DEVKITPRO}/calico/bin/ds7_maine.elf -9 ${PROG_NOINST} -d nds-data
	rm -fr nds-data

${PROG_NOINST}.nro: ${PROG_NOINST} testfile.txt
	rm -fr romfs
	mkdir -p romfs
	cp testfile.txt romfs
	nacptool --create "ObjFW tests" "Jonathan Schleifer" \

Modified tests/OFFileManagerTests.m from [08e4ea3058] to [fb37084320].

19
20
21
22
23
24
25




26
27
28
29
30
31
32

#include "config.h"

#include <errno.h>

#import "ObjFW.h"
#import "ObjFWTest.h"





@interface OFFileManagerTests: OTTestCase
{
	OFFileManager *_fileManager;
	OFIRI *_testsDirectoryIRI, *_testFileIRI;
}
@end







>
>
>
>







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

#include "config.h"

#include <errno.h>

#import "ObjFW.h"
#import "ObjFWTest.h"

#ifdef OF_HAIKU
# include <TypeConstants.h>
#endif

@interface OFFileManagerTests: OTTestCase
{
	OFFileManager *_fileManager;
	OFIRI *_testsDirectoryIRI, *_testFileIRI;
}
@end

Modified tests/OFINIFileTests.m from [f3bbd53585] to [00795e5f81].

115
116
117
118
119
120
121

122
123
124
125
126
127
128
	    @"global=yes\r\n"
	    @"\r\n"
	    @"[tests]\r\n"
	    @"foo=baz\r\n"
	    @"foobar=baz\r\n"
	    @";comment\r\n"
	    @"new=new\r\n"

	    @"\r\n"
	    @"[foobar]\r\n"
	    @"#foobarcomment\r\n"
	    @"qux=\" asd\"\r\n"
	    @"quxquxqux=\"hello\\\"wörld\"\r\n"
	    @"qux2=\"a\\n\"\r\n"
	    @"\"asd=asd\"=foobar\r\n"







>







115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
	    @"global=yes\r\n"
	    @"\r\n"
	    @"[tests]\r\n"
	    @"foo=baz\r\n"
	    @"foobar=baz\r\n"
	    @";comment\r\n"
	    @"new=new\r\n"
	    @"\"#quoted\"=\";comment\"\r\n"
	    @"\r\n"
	    @"[foobar]\r\n"
	    @"#foobarcomment\r\n"
	    @"qux=\" asd\"\r\n"
	    @"quxquxqux=\"hello\\\"wörld\"\r\n"
	    @"qux2=\"a\\n\"\r\n"
	    @"\"asd=asd\"=foobar\r\n"
141
142
143
144
145
146
147

148
149
150
151
152
153
154
	OFArray *array = [OFArray arrayWithObjects: @"foo", @"bar", nil];
#if defined(OF_HAVE_FILES) && !defined(OF_NINTENDO_DS)
	OFIRI *writeIRI;
#endif

	[tests setStringValue: @"baz" forKey: @"foo"];
	[tests setStringValue: @"new" forKey: @"new"];

	[foobar setStringValue: @"a\fb" forKey: @"qux3"];
	[types setLongLongValue: 0x10 forKey: @"integer"];
	[types setBoolValue: false forKey: @"bool"];
	[types setFloatValue: 0.25f forKey: @"float"];
	[types setDoubleValue: 0.75 forKey: @"double"];
	[types setArrayValue: array forKey: @"array1"];








>







142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
	OFArray *array = [OFArray arrayWithObjects: @"foo", @"bar", nil];
#if defined(OF_HAVE_FILES) && !defined(OF_NINTENDO_DS)
	OFIRI *writeIRI;
#endif

	[tests setStringValue: @"baz" forKey: @"foo"];
	[tests setStringValue: @"new" forKey: @"new"];
	[tests setStringValue: @";comment" forKey: @"#quoted"];
	[foobar setStringValue: @"a\fb" forKey: @"qux3"];
	[types setLongLongValue: 0x10 forKey: @"integer"];
	[types setBoolValue: false forKey: @"bool"];
	[types setFloatValue: 0.25f forKey: @"float"];
	[types setDoubleValue: 0.75 forKey: @"double"];
	[types setArrayValue: array forKey: @"array1"];

Modified utils/ofarc/Makefile from [5c95dc17f9] to [43d2a81be5].

16
17
18
19
20
21
22

23

24
25
26
27
28
29
PACKAGE_NAME = ofarc

${PROG}: ${LIBOBJFW_DEP_LVL2} ${LIBOBJFWRT_DEP_LVL2}

CPPFLAGS += -I../../src							\
	    -I../../src/runtime						\
	    -I../../src/exceptions					\

	    -I../..							\

	    -DLOCALIZATION_DIR=\"${datadir}/ofarc/localization\"
LIBS := -L../../src -L../../src/tls ${OFHTTP_LIBS} -lobjfw		\
	-L../../src/runtime ${RUNTIME_LIBS}				\
	${LIBS}
LD = ${OBJC}
LDFLAGS += ${LDFLAGS_RPATH}







>

>






16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
PACKAGE_NAME = ofarc

${PROG}: ${LIBOBJFW_DEP_LVL2} ${LIBOBJFWRT_DEP_LVL2}

CPPFLAGS += -I../../src							\
	    -I../../src/runtime						\
	    -I../../src/exceptions					\
	    -I../../src/tls						\
	    -I../..							\
	    -DOBJFWTLS_LOCAL_INCLUDES					\
	    -DLOCALIZATION_DIR=\"${datadir}/ofarc/localization\"
LIBS := -L../../src -L../../src/tls ${OFHTTP_LIBS} -lobjfw		\
	-L../../src/runtime ${RUNTIME_LIBS}				\
	${LIBS}
LD = ${OBJC}
LDFLAGS += ${LDFLAGS_RPATH}

Modified utils/ofarc/OFArc.m from [c72f4e8f7d] to [6a3f9faa56].

34
35
36
37
38
39
40




41
42
43
44
45
46
47
48
49
50
51
52








53
54
55
56
57
58
59

#import "OFArc.h"
#import "GZIPArchive.h"
#import "LHAArchive.h"
#import "TarArchive.h"
#import "ZIPArchive.h"
#import "ZooArchive.h"





#import "OFCreateDirectoryFailedException.h"
#import "OFGetItemAttributesFailedException.h"
#import "OFInvalidArgumentException.h"
#import "OFInvalidFormatException.h"
#import "OFNotImplementedException.h"
#import "OFOpenItemFailedException.h"
#import "OFReadFailedException.h"
#import "OFSeekFailedException.h"
#import "OFWriteFailedException.h"

#define bufferSize 4096









OF_APPLICATION_DELEGATE(OFArc)

static void
help(OFStream *stream, bool full, int status)
{
	[stream writeLine: OF_LOCALIZED(@"usage",







>
>
>
>












>
>
>
>
>
>
>
>







34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71

#import "OFArc.h"
#import "GZIPArchive.h"
#import "LHAArchive.h"
#import "TarArchive.h"
#import "ZIPArchive.h"
#import "ZooArchive.h"

#ifdef HAVE_TLS_SUPPORT
# import "ObjFWTLS.h"
#endif

#import "OFCreateDirectoryFailedException.h"
#import "OFGetItemAttributesFailedException.h"
#import "OFInvalidArgumentException.h"
#import "OFInvalidFormatException.h"
#import "OFNotImplementedException.h"
#import "OFOpenItemFailedException.h"
#import "OFReadFailedException.h"
#import "OFSeekFailedException.h"
#import "OFWriteFailedException.h"

#define bufferSize 4096

#ifdef HAVE_TLS_SUPPORT
void
_reference_to_ObjFWTLS(void)
{
	_ObjFWTLS_reference = 1;
}
#endif

OF_APPLICATION_DELEGATE(OFArc)

static void
help(OFStream *stream, bool full, int status)
{
	[stream writeLine: OF_LOCALIZED(@"usage",

Modified utils/ofhash/Makefile from [0495fa7239] to [59fb2027af].

11
12
13
14
15
16
17

18

19
20
21
22
23
24
PACKAGE_NAME = ofhash

${PROG}: ${LIBOBJFW_DEP_LVL2} ${LIBOBJFWRT_DEP_LVL2}

CPPFLAGS += -I../../src							\
	    -I../../src/runtime						\
	    -I../../src/exceptions					\

	    -I../..							\

	    -DLOCALIZATION_DIR=\"${datadir}/ofhash/localization\"
LIBS := -L../../src -L../../src/tls ${OFHASH_LIBS} -lobjfw		\
	-L../../src/runtime ${RUNTIME_LIBS}				\
	${LIBS}
LD = ${OBJC}
LDFLAGS += ${LDFLAGS_RPATH}







>

>






11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
PACKAGE_NAME = ofhash

${PROG}: ${LIBOBJFW_DEP_LVL2} ${LIBOBJFWRT_DEP_LVL2}

CPPFLAGS += -I../../src							\
	    -I../../src/runtime						\
	    -I../../src/exceptions					\
	    -I../../src/tls						\
	    -I../..							\
	    -DOBJFWTLS_LOCAL_INCLUDES					\
	    -DLOCALIZATION_DIR=\"${datadir}/ofhash/localization\"
LIBS := -L../../src -L../../src/tls ${OFHASH_LIBS} -lobjfw		\
	-L../../src/runtime ${RUNTIME_LIBS}				\
	${LIBS}
LD = ${OBJC}
LDFLAGS += ${LDFLAGS_RPATH}

Modified utils/ofhash/OFHash.m from [1cd535dba0] to [0751523db5].

32
33
34
35
36
37
38




39
40
41
42
43
44








45
46
47
48
49
50
51
#import "OFSHA224Hash.h"
#import "OFSHA256Hash.h"
#import "OFSHA384Hash.h"
#import "OFSHA512Hash.h"
#import "OFSandbox.h"
#import "OFSecureData.h"
#import "OFStdIOStream.h"





#import "OFOpenItemFailedException.h"
#import "OFReadFailedException.h"

@interface OFHash: OFObject <OFApplicationDelegate>
@end









OF_APPLICATION_DELEGATE(OFHash)

static void
help(void)
{
	[OFStdErr writeLine: OF_LOCALIZED(@"usage",







>
>
>
>






>
>
>
>
>
>
>
>







32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#import "OFSHA224Hash.h"
#import "OFSHA256Hash.h"
#import "OFSHA384Hash.h"
#import "OFSHA512Hash.h"
#import "OFSandbox.h"
#import "OFSecureData.h"
#import "OFStdIOStream.h"

#ifdef HAVE_TLS_SUPPORT
# import "ObjFWTLS.h"
#endif

#import "OFOpenItemFailedException.h"
#import "OFReadFailedException.h"

@interface OFHash: OFObject <OFApplicationDelegate>
@end

#ifdef HAVE_TLS_SUPPORT
void
_reference_to_ObjFWTLS(void)
{
	_ObjFWTLS_reference = 1;
}
#endif

OF_APPLICATION_DELEGATE(OFHash)

static void
help(void)
{
	[OFStdErr writeLine: OF_LOCALIZED(@"usage",

Modified utils/ofhttp/Makefile from [43152d1949] to [443b8f00c0].

14
15
16
17
18
19
20

21
22
23
24
25
26
${PROG}: ${LIBOBJFW_DEP_LVL2} ${LIBOBJFWRT_DEP_LVL2}

CPPFLAGS += -I../../src							\
	    -I../../src/runtime						\
	    -I../../src/exceptions					\
	    -I../../src/tls						\
	    -I../..							\

	    -DLOCALIZATION_DIR='"${datadir}/ofhttp/localization"'
LIBS := -L../../src -L../../src/tls ${OFHTTP_LIBS} -lobjfw		\
	-L../../src/runtime ${RUNTIME_LIBS}				\
	${LIBS}
LD = ${OBJC}
LDFLAGS += ${LDFLAGS_RPATH}







>






14
15
16
17
18
19
20
21
22
23
24
25
26
27
${PROG}: ${LIBOBJFW_DEP_LVL2} ${LIBOBJFWRT_DEP_LVL2}

CPPFLAGS += -I../../src							\
	    -I../../src/runtime						\
	    -I../../src/exceptions					\
	    -I../../src/tls						\
	    -I../..							\
	    -DOBJFWTLS_LOCAL_INCLUDES					\
	    -DLOCALIZATION_DIR='"${datadir}/ofhttp/localization"'
LIBS := -L../../src -L../../src/tls ${OFHTTP_LIBS} -lobjfw		\
	-L../../src/runtime ${RUNTIME_LIBS}				\
	${LIBS}
LD = ${OBJC}
LDFLAGS += ${LDFLAGS_RPATH}