少年修仙传客户端基础资源
hch
2024-04-01 d01413b00ef631ac20347716b23818b0b811f65f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
 * \file
 * Interface to the dynamic linker
 *
 * Author:
 *    Mono Team (http://www.mono-project.com)
 *
 * Copyright 2001-2004 Ximian, Inc.
 * Copyright 2004-2009 Novell, Inc.
 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
 */
#include <config.h>
 
#if defined (TARGET_MACH)
 
#include "mono/utils/mono-dl.h"
#include "mono/utils/mono-embed.h"
#include "mono/utils/mono-path.h"
 
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <glib.h>
#include <dlfcn.h>
#include <unistd.h>
#include <mach-o/dyld.h>
 
const char *
mono_dl_get_so_prefix (void)
{
    return "lib";
}
const char **
mono_dl_get_so_suffixes (void)
{
    static const char *suffixes[] = {
        ".dylib",
        ".so",
        ".bundle",
        "",
    };
    return suffixes;
}
 
int
mono_dl_get_executable_path (char *buf, int buflen)
{
    uint32_t bsize = buflen;
    if (_NSGetExecutablePath (buf, &bsize) == 0)
        return strlen (buf);
    return -1;
}
 
const char*
mono_dl_get_system_dir (void)
{
#ifdef TARGET_IOS
    /* IOS9 can't load system libraries using relative paths, i.e. 'libc' doesn't work, but '/usr/lib/libc' does. */
    return "/usr/lib";
#else
    return NULL;
#endif
}
 
#endif