Differences From Artifact [f7dad7806c]:
- File src/macros.h — part of check-in [3b97fc3cd9] at 2014-01-04 00:24:08 on branch trunk — Update copyright. (user: js, size: 9811) [annotate] [blame] [check-ins using]
To Artifact [3858acab50]:
- File
src/macros.h
— part of check-in
[2f5af58573]
at
2014-02-13 23:26:17
on branch trunk
— Use -std=c11 instead of -std=gnu11
Not using -std=gnu11 means _GNU_SOURCE does not get defined anymore,
therefore this commit also adds the required feature defines for glibc.Additionally, this adds of_strdup in macros.h, as strdup is an
extension. (user: js, size: 10044) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
16 17 18 19 20 21 22 23 24 25 26 27 28 29 | #import "OFObject.h" #include <stddef.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #if defined(OF_APPLE_RUNTIME) # import <objc/runtime.h> #endif #ifdef __GNUC__ # define OF_INLINE inline __attribute__((always_inline)) | > | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #import "OFObject.h" #include <stddef.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #if defined(OF_APPLE_RUNTIME) # import <objc/runtime.h> #endif #ifdef __GNUC__ # define OF_INLINE inline __attribute__((always_inline)) |
︙ | ︙ | |||
407 408 409 410 411 412 413 | of_rectangle_t rectangle = { of_point(x, y), of_dimension(width, height) }; return rectangle; } | > > > > > > > > > > > > > > | 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 | of_rectangle_t rectangle = { of_point(x, y), of_dimension(width, height) }; return rectangle; } static OF_INLINE char* of_strdup(const char *string) { char *copy; size_t length = strlen(string); if ((copy = malloc(length + 1)) == NULL) return NULL; memcpy(copy, string, length + 1); return copy; } |