Merge remote-tracking branch 'origin/master' into for-steve
[sxemacs] / src / sunOS-fix.c
1 /*
2 This file is part of SXEmacs
3
4 SXEmacs is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 SXEmacs is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
16
17
18 /* Synched up with: Not in FSF. */
19
20 /* If you are using SunOS 4.1.1 and X11r5, then you need this patch.
21    There is a stupid bug in the SunOS libc.a: two functions which X11r5
22    uses, mbstowcs() and wcstombs(), are unusable when programs are
23    statically linked (as Emacs must be) because the static version of
24    libc.a contains the *dynamic* versions of these functions.  These
25    functions don't seem to be called when Emacs is running, so it's
26    enough to define stubs for them.
27
28    This appears to be fixed in SunOS 4.1.2.
29  */
30
31 #include <config.h>
32
33 #ifndef I18N4                   /* we actually need these from the library in this case. */
34
35 #ifdef __STDC__
36
37 #include <stdlib.h>
38
39 size_t mbstowcs(wchar_t * foo, const char *bar, size_t baz)
40 {
41         abort();
42         return 0;
43 }
44
45 size_t wcstombs(char *foo, const wchar_t * bar, size_t baz)
46 {
47         abort();
48         return 0;
49 }
50
51 #else
52
53 void mbstowcs()
54 {
55         abort();
56 }
57
58 void wcstombs()
59 {
60         abort();
61 }
62
63 #endif                          /* __STDC__ */
64
65 #endif                          /* !I18N4 */