grub2: bring back build of aros-side grub2 tools
[AROS.git] / tools / flexcat / src / vastubs.c
blobcc0f8c768ba5d77b886538a598a788940b7fec77
1 /*
2 * $Id$
4 * Copyright (C) 1993-1999 by Jochen Wiedmann and Marcin Orlowski
5 * Copyright (C) 2002-2010 by the FlexCat Open Source Team
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 Stubs for the variable argument functions of the shared libraries used.
25 Please note that these stubs should only be used if the compiler
26 suite/SDK doesn't come with own stubs/inline functions.
28 Also note that these stubs are only safe on m68k machines as it
29 requires a linear stack layout!
32 #if !defined(__AROS__) && (defined(__VBCC__) || defined(NO_INLINE_STDARG))
33 #if defined(_M68000) || defined(__M68000) || defined(__mc68000)
35 #include <exec/types.h>
37 /* FIX V45 breakage... */
38 #if INCLUDE_VERSION < 45
39 #define MY_CONST_STRPTR CONST_STRPTR
40 #else
41 #define MY_CONST_STRPTR CONST STRPTR
42 #endif
44 #include <proto/locale.h>
45 struct Catalog *OpenCatalog(struct Locale *locale, STRPTR name, Tag tag1, ...)
46 { return OpenCatalogA(locale, name, (struct TagItem *)&tag1); }
48 #include <proto/codesets.h>
49 struct codeset *CodesetsFind(STRPTR name, Tag tag1, ...)
50 { return CodesetsFindA(name, (struct TagItem *)&tag1); }
51 STRPTR CodesetsConvertStr(Tag tag1, ...)
52 { return CodesetsConvertStrA((struct TagItem *)&tag1); }
53 STRPTR CodesetsUTF8ToStr(Tag tag1, ...)
54 { return CodesetsUTF8ToStrA((struct TagItem *)&tag1); }
56 #else
57 #error "VARGS stubs are only save on m68k systems!"
58 #endif // !defined(__PPC__)
60 #elif defined(__AROS__)
62 #include <proto/codesets.h>
63 STRPTR *CodesetsSupported(Tag tag1, ...)
65 #undef AROS_TAGRETURNTYPE
66 #define AROS_TAGRETURNTYPE STRPTR *
67 AROS_SLOWSTACKTAGS_PRE(tag1)
68 retval = (STRPTR *)CodesetsSupportedA((struct TagItem *)AROS_SLOWSTACKTAGS_ARG(tag1));
69 AROS_SLOWSTACKTAGS_POST
72 struct codeset *CodesetsFind(STRPTR name, Tag tag1, ...)
74 #undef AROS_TAGRETURNTYPE
75 #define AROS_TAGRETURNTYPE struct codeset *
76 AROS_SLOWSTACKTAGS_PRE(tag1)
77 retval = (struct codeset *)CodesetsFindA(name, (struct TagItem *)AROS_SLOWSTACKTAGS_ARG(tag1));
78 AROS_SLOWSTACKTAGS_POST
81 struct codeset *CodesetsFindBest(Tag tag1, ...)
83 AROS_SLOWSTACKTAGS_PRE(tag1)
84 retval = (struct codeset *)CodesetsFindBestA((struct TagItem *)AROS_SLOWSTACKTAGS_ARG(tag1));
85 AROS_SLOWSTACKTAGS_POST
88 STRPTR CodesetsConvertStr(Tag tag1, ...)
90 #undef AROS_TAGRETURNTYPE
91 #define AROS_TAGRETURNTYPE STRPTR
92 AROS_SLOWSTACKTAGS_PRE(tag1)
93 retval = (STRPTR)CodesetsConvertStrA((struct TagItem *)AROS_SLOWSTACKTAGS_ARG(tag1));
94 AROS_SLOWSTACKTAGS_POST
97 struct codesetList *CodesetsListCreate(Tag tag1, ...)
99 #undef AROS_TAGRETURNTYPE
100 #define AROS_TAGRETURNTYPE struct codesetList *
101 AROS_SLOWSTACKTAGS_PRE(tag1)
102 retval = (struct codesetList *)CodesetsListCreateA((struct TagItem *)AROS_SLOWSTACKTAGS_ARG(tag1));
103 AROS_SLOWSTACKTAGS_POST
106 BOOL CodesetsListDelete(Tag tag1, ...)
108 #undef AROS_TAGRETURNTYPE
109 #define AROS_TAGRETURNTYPE BOOL
110 AROS_SLOWSTACKTAGS_PRE(tag1)
111 retval = (BOOL)CodesetsListDeleteA((struct TagItem *)AROS_SLOWSTACKTAGS_ARG(tag1));
112 AROS_SLOWSTACKTAGS_POST
115 STRPTR CodesetsUTF8ToStr(Tag tag1, ...)
117 #undef AROS_TAGRETURNTYPE
118 #define AROS_TAGRETURNTYPE STRPTR
119 AROS_SLOWSTACKTAGS_PRE(tag1)
120 retval = (STRPTR)CodesetsUTF8ToStrA((struct TagItem *)AROS_SLOWSTACKTAGS_ARG(tag1));
121 AROS_SLOWSTACKTAGS_POST
124 UTF8 *CodesetsUTF8Create(Tag tag1, ...)
126 #undef AROS_TAGRETURNTYPE
127 #define AROS_TAGRETURNTYPE UTF8 *
128 AROS_SLOWSTACKTAGS_PRE(tag1)
129 retval = (UTF8 *)CodesetsUTF8CreateA((struct TagItem *)AROS_SLOWSTACKTAGS_ARG(tag1));
130 AROS_SLOWSTACKTAGS_POST
133 #endif // defined(__VBCC__) || defined(NO_INLINE_STDARG)