OSDN Git Service

authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 6 Jul 1998 23:03:02 +0000 (23:03 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 6 Jul 1998 23:03:02 +0000 (23:03 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@20976 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/cygwin32.h

index bc81171..73f5917 100644 (file)
@@ -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  <ian@cygnus.com>
                          Jeff Law          <law@cygnus.com>
 
+
+       * 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.
index 15963bd..1677422 100644 (file)
@@ -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 *));