Differences From Artifact [e3b6fb662f]:
- File src/runtime/selector.m — part of check-in [3b97fc3cd9] at 2014-01-04 00:24:08 on branch trunk — Update copyright. (user: js, size: 3310) [annotate] [blame] [check-ins using]
To Artifact [915bbfe8d7]:
- File
src/runtime/selector.m
— 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: 3333) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
19 20 21 22 23 24 25 26 27 28 29 30 31 32 | #include <stdio.h> #include <stdlib.h> #include <string.h> #import "runtime.h" #import "runtime-private.h" #ifdef OF_SELUID24 # define SEL_MAX 0xFFFFFF #else # define SEL_MAX 0xFFFF #endif static struct objc_hashtable *selectors = NULL; | > > | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | #include <stdio.h> #include <stdlib.h> #include <string.h> #import "runtime.h" #import "runtime-private.h" #import "macros.h" #ifdef OF_SELUID24 # define SEL_MAX 0xFFFFFF #else # define SEL_MAX 0xFFFF #endif static struct objc_hashtable *selectors = NULL; |
︙ | ︙ | |||
75 76 77 78 79 80 81 | objc_global_mutex_unlock(); return (SEL)rsel; } if ((sel = malloc(sizeof(struct objc_abi_selector))) == NULL) OBJC_ERROR("Not enough memory to allocate selector!"); | | | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | objc_global_mutex_unlock(); return (SEL)rsel; } if ((sel = malloc(sizeof(struct objc_abi_selector))) == NULL) OBJC_ERROR("Not enough memory to allocate selector!"); if ((sel->name = of_strdup(name)) == NULL) OBJC_ERROR("Not enough memory to allocate selector!"); sel->types = NULL; if ((free_list = realloc(free_list, sizeof(void*) * (free_list_cnt + 2))) == NULL) OBJC_ERROR("Not enough memory to allocate selector!"); |
︙ | ︙ |