Differences From Artifact [1976c624c2]:
- File
src/OFEmbeddedURIHandler.m
— part of check-in
[722bb308e8]
at
2022-11-17 14:50:12
on branch trunk
— Fix embedded files with GCC
The load order is different with GCC, resulting in a crash when trying
to send a message, so -[retain] cannot be used in
OFRegisterEmbeddedFile(). (user: js, size: 2850) [annotate] [blame] [check-ins using] [more...]
To Artifact [ba984847f3]:
- File src/OFEmbeddedIRIHandler.m — part of check-in [23272e6d43] at 2022-11-24 00:21:15 on branch trunk — Rename OFURI to OFIRI (user: js, size: 2850) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
15 16 17 18 19 20 21 | #include "config.h" #include <errno.h> #include <stdlib.h> #include <string.h> | | | | | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | #include "config.h" #include <errno.h> #include <stdlib.h> #include <string.h> #import "OFEmbeddedIRIHandler.h" #import "OFIRI.h" #import "OFMemoryStream.h" #import "OFInvalidArgumentException.h" #import "OFOpenItemFailedException.h" #ifdef OF_HAVE_THREADS # import "OFOnce.h" # import "OFPlainMutex.h" |
︙ | ︙ | |||
67 68 69 70 71 72 73 | numEmbeddedFiles++; #ifdef OF_HAVE_THREADS OFEnsure(OFPlainMutexUnlock(&mutex) == 0); #endif } | | | | | | | | | 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | numEmbeddedFiles++; #ifdef OF_HAVE_THREADS OFEnsure(OFPlainMutexUnlock(&mutex) == 0); #endif } @implementation OFEmbeddedIRIHandler - (OFStream *)openItemAtIRI: (OFIRI *)IRI mode: (OFString *)mode { OFString *path; if (![IRI.scheme isEqual: @"embedded"] || IRI.host.length > 0 || IRI.port != nil || IRI.user != nil || IRI.password != nil || IRI.query != nil || IRI.fragment != nil) @throw [OFInvalidArgumentException exception]; if (![mode isEqual: @"r"]) @throw [OFOpenItemFailedException exceptionWithIRI: IRI mode: mode errNo: EROFS]; if ((path = IRI.path) == nil) { @throw [OFInvalidArgumentException exception]; } #ifdef OF_HAVE_THREADS OFEnsure(OFPlainMutexLock(&mutex) == 0); @try { #endif |
︙ | ︙ | |||
106 107 108 109 110 111 112 | } #ifdef OF_HAVE_THREADS } @finally { OFEnsure(OFPlainMutexUnlock(&mutex) == 0); } #endif | | | 106 107 108 109 110 111 112 113 114 115 116 117 | } #ifdef OF_HAVE_THREADS } @finally { OFEnsure(OFPlainMutexUnlock(&mutex) == 0); } #endif @throw [OFOpenItemFailedException exceptionWithIRI: IRI mode: mode errNo: ENOENT]; } @end |