ObjFW  Check-in [a38d711e37]

Overview
Comment:runtime: Properly hide symbols
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: a38d711e37e1c76f2fabf7ae2f501927315f594177aa58d4d5f5782207efefc0
User & Date: js on 2024-06-23 22:04:56
Other Links: manifest | tags
Context
2024-06-30
12:17
ObjFWHID: Add profiles for Joy-Cons check-in: 96c7c533b1 user: js tags: trunk
2024-06-23
22:05
runtime: Properly hide symbols check-in: 0309533ff6 user: js tags: 1.1
22:04
runtime: Properly hide symbols check-in: a38d711e37 user: js tags: trunk
2024-06-18
22:15
OHN64Controller: Rename C-Pad to C-Buttons check-in: be7f15e75f user: js tags: trunk
Changes

Modified src/runtime/private.h from [001133848f] to [5dd68be0f7].

215
216
217
218
219
220
221
222

223
224
225
226
227
228

229

230
231
232
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
260

261
262
263

264
265
266
267
268
269
270
271
272
273

274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
		} *_Nonnull buckets[256];
#else
		IMP _Nullable buckets[256];
#endif
	} *_Nonnull buckets[256];
};

extern void objc_registerAllCategories(struct objc_symtab *_Nonnull);

extern struct objc_category *_Nullable *_Nullable
    objc_categoriesForClass(Class _Nonnull);
extern void objc_unregisterAllCategories(void);
extern void objc_initializeClass(Class _Nonnull);
extern void objc_updateDTable(Class _Nonnull);
extern void objc_registerAllClasses(struct objc_symtab *_Nonnull);

extern Class _Nullable objc_classnameToClass(const char *_Nonnull, bool);

extern void objc_unregisterClass(Class _Nonnull);
extern void objc_unregisterAllClasses(void);
extern uint32_t objc_string_hash(const void *_Nonnull);
extern bool objc_string_equal(const void *_Nonnull, const void *_Nonnull);

extern struct objc_hashtable *_Nonnull objc_hashtable_new(
    objc_hashtable_hash_func, objc_hashtable_equal_func, uint32_t);

extern struct objc_hashtable_bucket objc_deletedBucket;
extern void objc_hashtable_set(struct objc_hashtable *_Nonnull,
    const void *_Nonnull, const void *_Nonnull);
extern void *_Nullable objc_hashtable_get(struct objc_hashtable *_Nonnull,
    const void *_Nonnull);
extern void objc_hashtable_delete(struct objc_hashtable *_Nonnull,
    const void *_Nonnull);
extern void objc_hashtable_free(struct objc_hashtable *_Nonnull);

extern void objc_registerSelector(struct objc_selector *_Nonnull);

extern void objc_registerAllSelectors(struct objc_symtab *_Nonnull);

extern void objc_unregisterAllSelectors(void);
extern struct objc_sparsearray *_Nonnull objc_sparsearray_new(uint8_t);

extern void *_Nullable objc_sparsearray_get(struct objc_sparsearray *_Nonnull,
    uintptr_t);
extern void objc_sparsearray_set(struct objc_sparsearray *_Nonnull, uintptr_t,
    void *_Nullable);
extern void objc_sparsearray_free(struct objc_sparsearray *_Nonnull);

extern struct objc_dtable *_Nonnull objc_dtable_new(void);
extern void objc_dtable_copy(struct objc_dtable *_Nonnull,
    struct objc_dtable *_Nonnull);
extern void objc_dtable_set(struct objc_dtable *_Nonnull, uint32_t,
    IMP _Nullable);
extern void objc_dtable_free(struct objc_dtable *_Nonnull);
extern void objc_dtable_cleanup(void);
extern void objc_initStaticInstances(struct objc_symtab *_Nonnull);

extern void objc_forgetPendingStaticInstances(void);
extern void objc_zeroWeakReferences(id _Nonnull);
extern Class _Nullable object_getTaggedPointerClass(id _Nonnull);

#ifdef OF_HAVE_THREADS
extern void objc_globalMutex_lock(void);
extern void objc_globalMutex_unlock(void);
extern void objc_globalMutex_free(void);
#else
# define objc_globalMutex_lock()
# define objc_globalMutex_unlock()
# define objc_globalMutex_free()
#endif
extern char *_Nullable objc_strdup(const char *_Nonnull string);


static inline IMP _Nullable
objc_dtable_get(const struct objc_dtable *_Nonnull dtable, uint32_t idx)
{
#ifdef OF_SELUID24
	uint8_t i = idx >> 16;
	uint8_t j = idx >> 8;
	uint8_t k = idx;

	return dtable->buckets[i]->buckets[j]->buckets[k];
#else
	uint8_t i = idx >> 8;
	uint8_t j = idx;

	return dtable->buckets[i]->buckets[j];
#endif
}

extern void OF_NO_RETURN_FUNC objc_error(const char *_Nonnull title,
    const char *_Nonnull format, ...);
#define OBJC_ERROR(...)							\
	objc_error("ObjFWRT @ " __FILE__ ":" OF_STRINGIFY(__LINE__),	\
	    __VA_ARGS__)

#if defined(OF_ELF)
# if defined(OF_AMD64) || defined(OF_X86) || \
    defined(OF_POWERPC64) || defined(OF_POWERPC) || \







|
>

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

|
>
|

|

|

|
|
>
|
>
|
>
|
|
>

|

|
|
>
|

|

|
|
|
|
>
|
|
|
>

|
|
|





|
>

|

















|







215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
		} *_Nonnull buckets[256];
#else
		IMP _Nullable buckets[256];
#endif
	} *_Nonnull buckets[256];
};

extern void objc_registerAllCategories(struct objc_symtab *_Nonnull)
    OF_VISIBILITY_HIDDEN;
extern struct objc_category *_Nullable *_Nullable
    objc_categoriesForClass(Class _Nonnull) OF_VISIBILITY_HIDDEN;
extern void objc_unregisterAllCategories(void) OF_VISIBILITY_HIDDEN;
extern void objc_initializeClass(Class _Nonnull) OF_VISIBILITY_HIDDEN;
extern void objc_updateDTable(Class _Nonnull) OF_VISIBILITY_HIDDEN;
extern void objc_registerAllClasses(struct objc_symtab *_Nonnull)
    OF_VISIBILITY_HIDDEN;
extern Class _Nullable objc_classnameToClass(const char *_Nonnull, bool)
    OF_VISIBILITY_HIDDEN;
extern void objc_unregisterClass(Class _Nonnull) OF_VISIBILITY_HIDDEN;
extern void objc_unregisterAllClasses(void) OF_VISIBILITY_HIDDEN;
extern uint32_t objc_string_hash(const void *_Nonnull) OF_VISIBILITY_HIDDEN;
extern bool objc_string_equal(const void *_Nonnull, const void *_Nonnull)
    OF_VISIBILITY_HIDDEN;
extern struct objc_hashtable *_Nonnull objc_hashtable_new(
    objc_hashtable_hash_func, objc_hashtable_equal_func, uint32_t)
    OF_VISIBILITY_HIDDEN;
extern struct objc_hashtable_bucket objc_deletedBucket OF_VISIBILITY_HIDDEN;
extern void objc_hashtable_set(struct objc_hashtable *_Nonnull,
    const void *_Nonnull, const void *_Nonnull) OF_VISIBILITY_HIDDEN;
extern void *_Nullable objc_hashtable_get(struct objc_hashtable *_Nonnull,
    const void *_Nonnull) OF_VISIBILITY_HIDDEN;
extern void objc_hashtable_delete(struct objc_hashtable *_Nonnull,
    const void *_Nonnull) OF_VISIBILITY_HIDDEN;
extern void objc_hashtable_free(struct objc_hashtable *_Nonnull)
    OF_VISIBILITY_HIDDEN;
extern void objc_registerSelector(struct objc_selector *_Nonnull)
    OF_VISIBILITY_HIDDEN;
extern void objc_registerAllSelectors(struct objc_symtab *_Nonnull)
    OF_VISIBILITY_HIDDEN;
extern void objc_unregisterAllSelectors(void) OF_VISIBILITY_HIDDEN;
extern struct objc_sparsearray *_Nonnull objc_sparsearray_new(uint8_t)
    OF_VISIBILITY_HIDDEN;
extern void *_Nullable objc_sparsearray_get(struct objc_sparsearray *_Nonnull,
    uintptr_t) OF_VISIBILITY_HIDDEN;
extern void objc_sparsearray_set(struct objc_sparsearray *_Nonnull, uintptr_t,
    void *_Nullable) OF_VISIBILITY_HIDDEN;
extern void objc_sparsearray_free(struct objc_sparsearray *_Nonnull)
    OF_VISIBILITY_HIDDEN;
extern struct objc_dtable *_Nonnull objc_dtable_new(void) OF_VISIBILITY_HIDDEN;
extern void objc_dtable_copy(struct objc_dtable *_Nonnull,
    struct objc_dtable *_Nonnull) OF_VISIBILITY_HIDDEN;
extern void objc_dtable_set(struct objc_dtable *_Nonnull, uint32_t,
    IMP _Nullable) OF_VISIBILITY_HIDDEN;
extern void objc_dtable_free(struct objc_dtable *_Nonnull) OF_VISIBILITY_HIDDEN;
extern void objc_dtable_cleanup(void) OF_VISIBILITY_HIDDEN;
extern void objc_initStaticInstances(struct objc_symtab *_Nonnull)
    OF_VISIBILITY_HIDDEN;
extern void objc_forgetPendingStaticInstances(void) OF_VISIBILITY_HIDDEN;
extern void objc_zeroWeakReferences(id _Nonnull) OF_VISIBILITY_HIDDEN;
extern Class _Nullable object_getTaggedPointerClass(id _Nonnull)
    OF_VISIBILITY_HIDDEN;
#ifdef OF_HAVE_THREADS
extern void objc_globalMutex_lock(void) OF_VISIBILITY_HIDDEN;
extern void objc_globalMutex_unlock(void) OF_VISIBILITY_HIDDEN;
extern void objc_globalMutex_free(void) OF_VISIBILITY_HIDDEN;
#else
# define objc_globalMutex_lock()
# define objc_globalMutex_unlock()
# define objc_globalMutex_free()
#endif
extern char *_Nullable objc_strdup(const char *_Nonnull string)
    OF_VISIBILITY_HIDDEN;

static OF_INLINE IMP _Nullable
objc_dtable_get(const struct objc_dtable *_Nonnull dtable, uint32_t idx)
{
#ifdef OF_SELUID24
	uint8_t i = idx >> 16;
	uint8_t j = idx >> 8;
	uint8_t k = idx;

	return dtable->buckets[i]->buckets[j]->buckets[k];
#else
	uint8_t i = idx >> 8;
	uint8_t j = idx;

	return dtable->buckets[i]->buckets[j];
#endif
}

extern void OF_NO_RETURN_FUNC objc_error(const char *_Nonnull title,
    const char *_Nonnull format, ...) OF_VISIBILITY_HIDDEN;
#define OBJC_ERROR(...)							\
	objc_error("ObjFWRT @ " __FILE__ ":" OF_STRINGIFY(__LINE__),	\
	    __VA_ARGS__)

#if defined(OF_ELF)
# if defined(OF_AMD64) || defined(OF_X86) || \
    defined(OF_POWERPC64) || defined(OF_POWERPC) || \

Modified tests/plugin/TestPlugin.m from [08d2f004ac] to [4892884875].

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
44
45
46
47
48
49
50
 * <https://www.gnu.org/licenses/>.
 */

#include "config.h"

#import "TestPlugin.h"

#ifdef OF_OBJFW_RUNTIME
# import "runtime/private.h"

OF_DESTRUCTOR()
{
	Class class = objc_getClass("TestPlugin");

	if (class == Nil)
		/*
		 * musl has broken dlclose(): Instead of calling the destructor
		 * on dlclose(), they call it on exit(). This of course means
                 * that our tests might have already called objc_deinit() and
                 * the class is already gone.
		 */
		return;

	objc_unregisterClass(class);
}
#endif

@implementation TestPlugin
- (int)test: (int)num
{
	return num * 2;
}
@end








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







17
18
19
20
21
22
23




















24
25
26
27
28
29
30
 * <https://www.gnu.org/licenses/>.
 */

#include "config.h"

#import "TestPlugin.h"





















@implementation TestPlugin
- (int)test: (int)num
{
	return num * 2;
}
@end