Imported Upstream version 1.1.11
[platform/upstream/cdrkit.git] / include / allocax.h
1 /*
2  * This file has been modified for the cdrkit suite.
3  *
4  * The behaviour and appearence of the program code below can differ to a major
5  * extent from the version distributed by the original author(s).
6  *
7  * For details, see Changelog file distributed with the cdrkit package. If you
8  * received this file from another source then ask the distributing person for
9  * a log of modifications.
10  *
11  */
12
13 /* @(#)allocax.h        1.3 03/07/15 Copyright 2002 J. Schilling */
14 /*
15  *      Definitions for users of alloca()
16  *
17  *      Important: #include this directly after <mconfig.h>
18  *      and before any other include file.
19  *      See comment in _AIX part below.
20  *
21  *      Copyright (c) 2002 J. Schilling
22  */
23 /*
24  * This program is free software; you can redistribute it and/or modify
25  * it under the terms of the GNU General Public License version 2
26  * as published by the Free Software Foundation.
27  *
28  * This program is distributed in the hope that it will be useful,
29  * but WITHOUT ANY WARRANTY; without even the implied warranty of
30  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
31  * GNU General Public License for more details.
32  *
33  * You should have received a copy of the GNU General Public License along with
34  * this program; see the file COPYING.  If not, write to the Free Software
35  * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
36  */
37
38
39 #ifndef _ALLOCAX_H
40 #define _ALLOCAX_H
41
42 #ifdef __GNUC__
43 #       ifndef  alloca
44 #               define  alloca(s)       __builtin_alloca(s)
45 #       endif
46 #else
47 #       ifdef _MSC_VER
48 #               include <malloc.h>
49 #               define alloca _alloca
50 #       else
51 #               ifdef HAVE_ALLOCA_H
52 #                       include <alloca.h>
53 #               else
54 #                       ifdef _AIX
55                                 /*
56                                  * Indent so pre-ANSI compilers will ignore it
57                                  *
58                                  * Some versions of AIX may require this to be
59                                  * first in the file and only preceded by
60                                  * comments and preprocessor directives/
61                                  */
62                                 #pragma alloca
63 #                       else
64 #                               ifndef alloca
65                                         /*
66                                          * predefined by HP cc +Olibcalls
67                                          */
68 #                                       ifdef   PROTOTYPES
69                                                 extern void *alloca();
70 #                                       else
71                                                 extern char *alloca();
72 #                                       endif
73 #                               endif
74 #                       endif
75 #               endif
76 #       endif
77 #endif
78
79
80 #endif  /* _ALLOCAX_H */