PageRenderTime 18ms CodeModel.GetById 12ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/llcommon/ctype_workaround.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 54 lines | 13 code | 7 blank | 34 comment | 0 complexity | bfb13c1583d8a90539bd68cd838487e2 MD5 | raw file
 1/** 
 2 * @file ctype_workaround.h
 3 * @brief The workaround is to create some legacy symbols that point
 4 * to the correct symbols, which avoids link errors.
 5 *
 6 * $LicenseInfo:firstyear=2006&license=viewerlgpl$
 7 * Second Life Viewer Source Code
 8 * Copyright (C) 2010, Linden Research, Inc.
 9 * 
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation;
13 * version 2.1 of the License only.
14 * 
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 * Lesser General Public License for more details.
19 * 
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
23 * 
24 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
25 * $/LicenseInfo$
26 */
27
28#ifndef _CTYPE_WORKAROUND_H_
29#define _CTYPE_WORKAROUND_H_
30
31/**
32 * the CTYPE_WORKAROUND is needed for linux dev stations that don't
33 * have the broken libc6 packages needed by our out-of-date static
34 * libs (such as libcrypto and libcurl).
35 *
36 * -- Leviathan 20060113
37*/
38
39#include <cctype>
40
41__const unsigned short int *__ctype_b;
42__const __int32_t *__ctype_tolower;
43__const __int32_t *__ctype_toupper;
44
45// call this function at the beginning of main() 
46void ctype_workaround()
47{
48	__ctype_b = *(__ctype_b_loc());
49	__ctype_toupper = *(__ctype_toupper_loc());
50	__ctype_tolower = *(__ctype_tolower_loc());
51}
52
53#endif
54