Differences From Artifact [77e3c3a21e]:
- File
src/OFFile.m
— part of check-in
[fe2cbe0021]
at
2018-04-22 16:13:04
on branch trunk
— runtime: Define BOOL to be the same as bool
As we define the ABI, we can just replace BOOL with bool everywhere,
including in ObjFW itself. For the Apple platforms where BOOL and bool
are different, this is not a problem as BOOL and bool are passed and
returned the same way in the ABI.This still defines BOOL to bool for compatibility, except on AmigaOS and
Wii, which both have its own BOOL type. (user: js, size: 10973) [annotate] [blame] [check-ins using]
To Artifact [8331bd9e6b]:
- File src/OFFile.m — part of check-in [b16fc262c0] at 2018-04-23 22:19:10 on branch trunk — Use more native AmigaOS APIs on AmigaOS 3 (user: js, size: 11485) [annotate] [blame] [check-ins using]
︙ | |||
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | + + + + + + + - + | # include <fat.h> #endif #ifdef OF_NINTENDO_DS # include <stdbool.h> # include <filesystem.h> #endif #ifdef OF_AMIGAOS # ifdef OF_AMIGAOS3 # define INTUITION_CLASSES_H # endif # include <proto/dos.h> #endif #ifndef O_BINARY # define O_BINARY 0 #endif #ifndef O_CLOEXEC # define O_CLOEXEC 0 #endif #ifndef O_EXCL # define O_EXCL 0 #endif #ifndef O_EXLOCK # define O_EXLOCK 0 #endif |
︙ | |||
99 100 101 102 103 104 105 | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | - + | { for (of_file_handle_t iter = firstHandle; iter != NULL; iter = iter->next) Close(iter->handle); } #endif |
︙ | |||
205 206 207 208 209 210 211 | 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | - + | { of_file_handle_t handle; @try { void *pool = objc_autoreleasePoolPush(); int flags; |
︙ | |||
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 | + + + + | @throw [OFOpenItemFailedException exceptionWithPath: path mode: mode errNo: errNo]; } if (handle->append) { # ifdef OF_MORPHOS if (Seek64(handle->handle, 0, OFFSET_END) == -1) { # else if (Seek(handle->handle, 0, OFFSET_END) == -1) { # endif Close(handle->handle); @throw [OFOpenItemFailedException exceptionWithPath: path mode: mode errNo: EIO]; } } |
︙ | |||
359 360 361 362 363 364 365 | 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | - + | if (length > UINT_MAX) @throw [OFOutOfRangeException exception]; if ((ret = read(_handle, buffer, (unsigned int)length)) < 0) @throw [OFReadFailedException exceptionWithObject: self requestedLength: length errNo: errno]; |
︙ | |||
397 398 399 400 401 402 403 | 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 | - + + + + + | @throw [OFOutOfRangeException exception]; if ((bytesWritten = write(_handle, buffer, (int)length)) < 0) @throw [OFWriteFailedException exceptionWithObject: self requestedLength: length bytesWritten: 0 errNo: errno]; |
︙ | |||
441 442 443 444 445 446 447 | 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 | - + + + - + - + - + + - - + + + + + + + - + | whence: (int)whence { of_offset_t ret; if (_handle == OF_INVALID_FILE_HANDLE) @throw [OFNotOpenException exceptionWithObject: self]; |
︙ |