少年修仙传客户端基础资源
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
/**
 * \file
 * Hardware feature detection
 *
 * Authors:
 *    Alex Rønne Petersen (alexrp@xamarin.com)
 *    Elijah Taylor (elijahtaylor@google.com)
 *    Miguel de Icaza (miguel@xamarin.com)
 *    Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com)
 *    Paolo Molaro (lupus@xamarin.com)
 *    Rodrigo Kumpera (kumpera@gmail.com)
 *    Sebastien Pouliot (sebastien@xamarin.com)
 *    Zoltan Varga (vargaz@xamarin.com)
 *
 * Copyright 2003 Ximian, Inc.
 * Copyright 2003-2011 Novell, Inc
 * Copyright 2006 Broadcom
 * Copyright 2007-2008 Andreas Faerber
 * Copyright 2011-2013 Xamarin Inc
 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
 */
 
#include <stdlib.h>
#include <string.h>
 
#include "mono/utils/mono-hwcap.h"
 
#define MONO_HWCAP_VAR(NAME) gboolean mono_hwcap_ ## NAME = FALSE;
#include "mono/utils/mono-hwcap-vars.h"
#undef MONO_HWCAP_VAR
 
static gboolean hwcap_inited = FALSE;
 
void
mono_hwcap_init (void)
{
    char *verbose = g_getenv ("MONO_VERBOSE_HWCAP");
    char *conservative = g_getenv ("MONO_CONSERVATIVE_HWCAP");
 
    if (hwcap_inited)
        return;
 
    if (!conservative || strncmp (conservative, "1", 1))
        mono_hwcap_arch_init ();
 
    if (verbose && !strncmp (verbose, "1", 1))
        mono_hwcap_print ();
 
    g_free (verbose);
    g_free (conservative);
}
 
void
mono_hwcap_print (void)
{
    g_print ("[mono-hwcap] Detected following hardware capabilities:\n\n");
 
#define MONO_HWCAP_VAR(NAME) g_print ("\t" #NAME " = %s\n", mono_hwcap_ ## NAME ? "yes" : "no");
#include "mono/utils/mono-hwcap-vars.h"
#undef MONO_HWCAP_VAR
 
    g_print ("\n");
}