From 672a233f2d8305ec123f5bcce4d67936077a7ae1 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 6 Jul 1998 23:03:02 +0000 Subject: [PATCH] cygwin32.h: Add some declaration of external functions. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit � * i386/cygwin32.h: Add some declaration of external functions. (ASM_DECLARE_FUNCTION_NAME): Define. (ASM_OUTPUT_EXTERNAL, ASM_OUTPUT_EXTERNAL_LIBCALL): Define. (ASM_FILE_END): Define. * i386/winnt.c (i386_pe_declare_function_type): New function. (struct extern_list, extern_head): Define. (i386_pe_record_external_function): New function. (i386_pe_asm_file_end): New function. Co-Authored-By: Jeffrey A Law From-SVN: r20976 --- gcc/ChangeLog | 10 ++++++++ gcc/config/i386/cygwin32.h | 50 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bc811716fb7..73f591740e0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -52,6 +52,16 @@ Mon Jul 6 22:14:31 1998 Richard Henderson (rth@cygnus.com) Mon Jul 6 22:09:32 1998 Ian Lance Taylor Jeff Law + + * i386/cygwin32.h: Add some declaration of external functions. + (ASM_DECLARE_FUNCTION_NAME): Define. + (ASM_OUTPUT_EXTERNAL, ASM_OUTPUT_EXTERNAL_LIBCALL): Define. + (ASM_FILE_END): Define. + * i386/winnt.c (i386_pe_declare_function_type): New function. + (struct extern_list, extern_head): Define. + (i386_pe_record_external_function): New function. + (i386_pe_asm_file_end): New function. + * cpplib.c (cpp_options_init): Initialize cplusplus_comments to 1, matching July 18, 1995 change to cccp.c. If -traditional then disable cplusplus_comments. diff --git a/gcc/config/i386/cygwin32.h b/gcc/config/i386/cygwin32.h index 15963bdb299..1677422af91 100644 --- a/gcc/config/i386/cygwin32.h +++ b/gcc/config/i386/cygwin32.h @@ -224,6 +224,36 @@ do { \ ? "discard" : "same_size"); \ } while (0) +/* Write the extra assembler code needed to declare a function + properly. If we are generating SDB debugging information, this + will happen automatically, so we only need to handle other cases. */ +#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ + do \ + { \ + if (write_symbols != SDB_DEBUG) \ + i386_pe_declare_function_type (FILE, NAME, TREE_PUBLIC (DECL)); \ + ASM_OUTPUT_LABEL (FILE, NAME); \ + } \ + while (0) + +/* Add an external function to the list of functions to be declared at + the end of the file. */ +#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \ + do \ + { \ + if (TREE_CODE (DECL) == FUNCTION_DECL) \ + i386_pe_record_external_function (NAME); \ + } \ + while (0) + +/* Declare the type properly for any external libcall. */ +#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \ + i386_pe_declare_function_type (FILE, XSTR (FUN, 0), 1) + +/* Output function declarations at the end of the file. */ +#define ASM_FILE_END(FILE) \ + i386_pe_asm_file_end (FILE) + #undef ASM_COMMENT_START #define ASM_COMMENT_START " #" @@ -232,3 +262,23 @@ do { \ /* Don't assume anything about the header files. */ #define NO_IMPLICIT_EXTERN_C + +/* External function declarations. */ + +#ifndef PROTO +#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__) +#define PROTO(ARGS) ARGS +#else +#define PROTO(ARGS) () +#endif +#endif + +#ifdef BUFSIZE /* stdio.h has been included, ok to use FILE * */ +#define STDIO_PROTO(ARGS) PROTO(ARGS) +#else +#define STDIO_PROTO(ARGS) () +#endif + +extern void i386_pe_record_external_function PROTO((char *)); +extern void i386_pe_declare_function_type STDIO_PROTO((FILE *, char *, int)); +extern void i386_pe_asm_file_end STDIO_PROTO((FILE *)); -- 2.30.2