1995-04-18 14:16:51 -04:00
|
|
|
/* Pragma related interfaces.
|
1999-04-26 17:18:08 -04:00
|
|
|
Copyright (C) 1995, 1998, 1999 Free Software Foundation, Inc.
|
1995-04-18 14:16:51 -04:00
|
|
|
|
|
|
|
This file is part of GNU CC.
|
|
|
|
|
|
|
|
GNU CC is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
GNU CC is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with GNU CC; see the file COPYING. If not, write to
|
1995-06-15 07:33:25 -04:00
|
|
|
the Free Software Foundation, 59 Temple Place - Suite 330,
|
|
|
|
Boston, MA 02111-1307, USA. */
|
1995-04-18 14:16:51 -04:00
|
|
|
|
1998-10-01 06:50:15 -04:00
|
|
|
#ifndef _C_PRAGMA_H
|
|
|
|
#define _C_PRAGMA_H
|
1998-09-02 05:59:57 -04:00
|
|
|
|
1998-10-01 06:50:15 -04:00
|
|
|
#ifdef HANDLE_SYSV_PRAGMA
|
1995-05-15 21:02:59 -04:00
|
|
|
/* Support #pragma weak iff ASM_WEAKEN_LABEL and ASM_OUTPUT_DEF are
|
|
|
|
defined. */
|
|
|
|
#if defined (ASM_WEAKEN_LABEL) && defined (ASM_OUTPUT_DEF)
|
|
|
|
#define HANDLE_PRAGMA_WEAK SUPPORTS_WEAK
|
1995-04-18 14:16:51 -04:00
|
|
|
#endif
|
|
|
|
|
1998-10-01 06:50:15 -04:00
|
|
|
/* We always support #pragma pack for SYSV pragmas. */
|
|
|
|
#ifndef HANDLE_PRAGMA_PACK
|
|
|
|
#define HANDLE_PRAGMA_PACK 1
|
|
|
|
#endif
|
|
|
|
#endif /* HANDLE_SYSV_PRAGMA */
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
|
|
|
|
/* If we are supporting #pragma pack(push... then we automatically
|
|
|
|
support #pragma pack(<n>) */
|
|
|
|
#define HANDLE_PRAGMA_PACK 1
|
|
|
|
#define PRAGMA_INSERT_ATTRIBUTES(node, pattr, prefix_attr) \
|
|
|
|
insert_pack_attributes (node, pattr, prefix_attr)
|
|
|
|
extern void insert_pack_attributes PROTO((tree, tree *, tree *));
|
|
|
|
#endif /* HANDLE_PRAGMA_PACK_PUSH_POP */
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HANDLE_PRAGMA_WEAK
|
|
|
|
/* This structure contains any weak symbol declarations waiting to be emitted. */
|
|
|
|
struct weak_syms
|
|
|
|
{
|
|
|
|
struct weak_syms * next;
|
|
|
|
char * name;
|
|
|
|
char * value;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Declared in varasm.c */
|
|
|
|
extern struct weak_syms * weak_decls;
|
1999-02-25 20:29:21 -05:00
|
|
|
|
|
|
|
extern int add_weak PROTO((char *, char *));
|
1998-10-01 06:50:15 -04:00
|
|
|
#endif /* HANDLE_PRAGMA_WEAK */
|
|
|
|
|
|
|
|
|
|
|
|
#if defined HANDLE_PRAGMA_PACK || defined HANDLE_PRAGMA_WEAK
|
|
|
|
/* Define HANDLE_GENERIC_PRAGMAS if any kind of front-end pragma
|
|
|
|
parsing is to be done. The code in GCC's generic C source files
|
|
|
|
will only look for the definition of this constant. They will
|
1998-10-07 10:48:02 -04:00
|
|
|
ignore definitions of HANDLE_PRAGMA_PACK and so on. */
|
1998-10-01 06:50:15 -04:00
|
|
|
#define HANDLE_GENERIC_PRAGMAS 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HANDLE_GENERIC_PRAGMAS
|
1995-04-18 14:16:51 -04:00
|
|
|
enum pragma_state
|
|
|
|
{
|
|
|
|
ps_start,
|
|
|
|
ps_done,
|
1998-10-01 06:50:15 -04:00
|
|
|
#ifdef HANDLE_PRAGMA_WEAK
|
1995-04-18 14:16:51 -04:00
|
|
|
ps_weak,
|
|
|
|
ps_name,
|
|
|
|
ps_equals,
|
|
|
|
ps_value,
|
1998-10-01 06:50:15 -04:00
|
|
|
#endif
|
|
|
|
#ifdef HANDLE_PRAGMA_PACK
|
1995-04-18 14:16:51 -04:00
|
|
|
ps_pack,
|
|
|
|
ps_left,
|
|
|
|
ps_align,
|
1998-10-01 06:50:15 -04:00
|
|
|
ps_right,
|
|
|
|
#endif
|
|
|
|
#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
|
1999-04-26 17:18:08 -04:00
|
|
|
ps_push, ps_pushcomma, ps_pushid, ps_pushcomma2,
|
|
|
|
ps_pop, ps_popcomma,
|
1998-10-01 06:50:15 -04:00
|
|
|
#endif
|
|
|
|
ps_bad
|
1995-04-18 14:16:51 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Handle a C style pragma */
|
bitmap.c (bitmap_print): Qualify a char* with the `const' keyword.
* bitmap.c (bitmap_print): Qualify a char* with the `const' keyword.
* bitmap.h (bitmap_print): Likewise.
* c-decl.c (builtin_function, grokdeclarator, grokfield): Likewise.
* c-lang.c (build_objc_string): Likewise.
* c-lex.c (yyerror, extend_token_buffer): Likewise. Don't include
limits.h or ctype.h. Remove unused variable `p'.
* c-lex.h (yyerror): Qualify a char* with the `const' keyword.
* c-pragma.c (handle_pragma_token): Likewise.
* c-pragma.h (handle_pragma_token): Likewise.
* c-tree.h (build_objc_string, builtin_function, grokfield,
build_indirect_ref, lvalue_or_else, readonly_warning, error_init,
pedwarn_init): Likewise.
* c-typeck.c (convert_for_assignment, warn_for_assignment,
push_string, warning_init, incomplete_type_error,
build_indirect_ref, lvalue_or_else, readonly_warning,
build_c_cast, spelling, push_member_name, print_spelling,
error_init, pedwarn_init, start_init): Likewise.
* objc/objc-act.c (build_objc_string): Likewise.
* print-tree.c (print_node_brief, print_node): Likewise.
* tree.h (lvalue_or_else, print_node, print_node_brief): Likewise.
From-SVN: r25296
1999-02-18 15:38:48 -05:00
|
|
|
extern int handle_pragma_token PROTO((const char *, tree));
|
1998-09-02 05:59:57 -04:00
|
|
|
|
1998-10-01 06:50:15 -04:00
|
|
|
#endif /* HANDLE_GENERIC_PRAGMAS */
|
|
|
|
#endif /* _C_PRAGMA_H */
|