⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cygwin.h

📁 gcc-you can use this code to learn something about gcc, and inquire further into linux,
💻 H
📖 第 1 页 / 共 2 页
字号:
/* Operating system specific defines to be used when targeting GCC for   hosting on Windows32, using a Unix style C library and tools.   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003   Free Software Foundation, Inc.This file is part of GNU CC.GNU CC is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe 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 ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with GNU CC; see the file COPYING.  If not, write tothe Free Software Foundation, 59 Temple Place - Suite 330,Boston, MA 02111-1307, USA.  */#define DBX_DEBUGGING_INFO 1#define SDB_DEBUGGING_INFO 1#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG#define TARGET_VERSION fprintf (stderr, " (x86 Cygwin)"); #define TARGET_EXECUTABLE_SUFFIX ".exe"#include <stdio.h>#include "i386/i386.h"#include "i386/unix.h"#include "i386/bsd.h"#include "i386/gas.h"#include "dbxcoff.h"/* Masks for subtarget switches used by other files.  */#define MASK_NOP_FUN_DLLIMPORT 0x08000000 /* Ignore dllimport for functions *//* Used in winnt.c.  */#define TARGET_NOP_FUN_DLLIMPORT (target_flags & MASK_NOP_FUN_DLLIMPORT)#undef  SUBTARGET_SWITCHES#define SUBTARGET_SWITCHES \{ "cygwin",		  0, N_("Use the Cygwin interface") },	\{ "no-cygwin",		  0, N_("Use the Mingw32 interface") },	\{ "windows",		  0, N_("Create GUI application") },	\{ "no-win32",		  0, N_("Don't set Windows defines") },	\{ "win32",		  0, N_("Set Windows defines") },	\{ "console",		  0, N_("Create console application") },\{ "dll",		  0, N_("Generate code for a DLL") },	\{ "nop-fun-dllimport",	  MASK_NOP_FUN_DLLIMPORT,		\  N_("Ignore dllimport for functions") }, 			\{ "no-nop-fun-dllimport", -MASK_NOP_FUN_DLLIMPORT, "" },	\{ "threads",		  0, N_("Use Mingw-specific thread support") },#define MAYBE_UWIN_CPP_BUILTINS() /* Nothing.  */#define TARGET_OS_CPP_BUILTINS()					\  do									\    {									\	builtin_define ("_X86_=1");					\	builtin_assert ("system=winnt");				\	builtin_define ("__stdcall=__attribute__((__stdcall__))");	\	builtin_define ("__cdecl=__attribute__((__cdecl__))");		\	builtin_define ("__declspec(x)=__attribute__((x))");		\	if (!flag_iso)							\	  {								\	    builtin_define ("_stdcall=__attribute__((__stdcall__))");	\	    builtin_define ("_cdecl=__attribute__((__cdecl__))");	\	  }								\	MAYBE_UWIN_CPP_BUILTINS ();					\    }									\  while (0)#ifdef CROSS_COMPILE#define CYGWIN_INCLUDES "%{!nostdinc:-idirafter " CYGWIN_CROSS_DIR "/include}"#define W32API_INC "%{!nostdinc:-idirafter " CYGWIN_CROSS_DIR "/include/w32api}"#define W32API_LIB "-L" CYGWIN_CROSS_DIR "/lib/w32api/"#define CYGWIN_LIB CYGWIN_CROSS_DIR "/lib"#define MINGW_LIBS "-L" CYGWIN_CROSS_DIR "/lib/mingw"#define MINGW_INCLUDES "%{!nostdinc:-isystem " CYGWIN_CROSS_DIR "/include/mingw/g++-3 "\		       "-isystem " CYGWIN_CROSS_DIR "/include/mingw/g++ "\		       "-idirafter " CYGWIN_CROSS_DIR "/include/mingw}"#else#define CYGWIN_INCLUDES "%{!nostdinc:-isystem /usr/local/include "\		           "-idirafter " CYGWIN_CROSS_DIR "/include "\		           "-idirafter /usr/include}"#define W32API_INC "%{!nostdinc:"\		      "-idirafter " CYGWIN_CROSS_DIR "/include/w32api "\		      "-idirafter /usr/include/w32api}"#define W32API_LIB "-L" CYGWIN_CROSS_DIR "/lib/w32api/ -L/usr/lib/w32api/"#define CYGWIN_LIB "/usr/lib"#define MINGW_LIBS "-L/usr/local/lib/mingw -L/usr/lib/mingw"#define MINGW_INCLUDES "%{!nostdinc:-isystem /usr/include/mingw/g++-3 "\		       "-isystem /usr/include/mingw/g++ "\		       "-isystem /usr/local/include/mingw "\		       "-idirafter " CYGWIN_CROSS_DIR "/include/mingw "\		       "-idirafter /usr/include/mingw}"#endif/* Get tree.c to declare a target-specific specialization of   merge_decl_attributes.  */#define TARGET_DLLIMPORT_DECL_ATTRIBUTES/* Support the __declspec keyword by turning them into attributes.   We currently only support: dllimport and dllexport.   Note that the current way we do this may result in a collision with   predefined attributes later on.  This can be solved by using one attribute,   say __declspec__, and passing args to it.  The problem with that approach   is that args are not accumulated: each new appearance would clobber any   existing args.  */#undef CPP_SPEC#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} \  %{mno-win32:%{mno-cygwin: %emno-cygwin and mno-win32 are not compatible}} \  %{mno-cygwin:-D__MSVCRT__ -D__MINGW32__ %{mthreads:-D_MT} "\    MINGW_INCLUDES "} \  %{!mno-cygwin:-D__CYGWIN32__ -D__CYGWIN__ %{!ansi:-Dunix} -D__unix__ -D__unix "\    CYGWIN_INCLUDES "}\  %{mwin32|mno-cygwin:-DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ %{!ansi:-DWINNT}}\  %{!mno-win32:" W32API_INC "}\"#undef STARTFILE_SPEC#define STARTFILE_SPEC "\  %{shared|mdll: %{mno-cygwin:" MINGW_LIBS " dllcrt2%O%s}}\  %{!shared: %{!mdll: %{!mno-cygwin:crt0%O%s} %{mno-cygwin:" MINGW_LIBS " crt2%O%s}\  %{pg:gcrt0%O%s}}}\"/* Normally, -lgcc is not needed since everything in it is in the DLL, but we   want to allow things to be added to it when installing new versions of   GCC without making a new CYGWIN.DLL, so we leave it.  Profiling is handled   by calling the init function from the prologue.  */#undef LIBGCC_SPEC#define LIBGCC_SPEC "%{mno-cygwin: %{mthreads:-lmingwthrd} -lmingw32}	\  -lgcc %{mno-cygwin:-lmoldname -lmingwex -lmsvcrt}"/* This macro defines names of additional specifications to put in the specs   that can be used in various specifications like CC1_SPEC.  Its definition   is an initializer with a subgrouping for each command option.   Each subgrouping contains a string constant, that defines the   specification name, and a string constant that used by the GNU CC driver   program.   Do not define this macro if it does not need to do anything.  */#undef  SUBTARGET_EXTRA_SPECS#define SUBTARGET_EXTRA_SPECS 						\  { "mingw_include_path", DEFAULT_TARGET_MACHINE }/* We have to dynamic link to get to the system DLLs.  All of libc, libm and   the Unix stuff is in cygwin.dll.  The import library is called   'libcygwin.a'.  For Windows applications, include more libraries, but   always include kernel32.  We'd like to specific subsystem windows to   ld, but that doesn't work just yet.  */#undef LIB_SPEC#define LIB_SPEC "\  %{pg:-lgmon} \  %{!mno-cygwin:-lcygwin} \  %{mno-cygwin:%{mthreads:-lmingwthrd} -lmingw32} \  %{mwindows:-lgdi32 -lcomdlg32} \  -luser32 -lkernel32 -ladvapi32 -lshell32"#define LINK_SPEC W32API_LIB "\  %{mwindows:--subsystem windows} \  %{mconsole:--subsystem console} \  %{shared: %{mdll: %eshared and mdll are not compatible}} \  %{shared: --shared} %{mdll:--dll} \  %{static:-Bstatic} %{!static:-Bdynamic} \  %{shared|mdll: -e \    %{mno-cygwin:_DllMainCRTStartup@12} \    %{!mno-cygwin:__cygwin_dll_entry@12}}\  --dll-search-prefix=cyg"#undef MATH_LIBRARY#define MATH_LIBRARY ""#define SIZE_TYPE "unsigned int"#define PTRDIFF_TYPE "int"#define WCHAR_TYPE_SIZE 16#define WCHAR_TYPE "short unsigned int"/* Enable parsing of #pragma pack(push,<n>) and #pragma pack(pop).  */#define HANDLE_PRAGMA_PACK_PUSH_POP 1union tree_node;#define TREE union tree_node *#undef EXTRA_SECTIONS#define EXTRA_SECTIONS in_drectve#undef EXTRA_SECTION_FUNCTIONS#define EXTRA_SECTION_FUNCTIONS					\  DRECTVE_SECTION_FUNCTION					\  SWITCH_TO_SECTION_FUNCTION#define DRECTVE_SECTION_FUNCTION \void									\drectve_section ()							\{									\  if (in_section != in_drectve)						\    {									\      fprintf (asm_out_file, "%s\n", "\t.section .drectve\n");		\      in_section = in_drectve;						\    }									\}void drectve_section PARAMS ((void));/* Switch to SECTION (an `enum in_section').   ??? This facility should be provided by GCC proper.   The problem is that we want to temporarily switch sections in   ASM_DECLARE_OBJECT_NAME and then switch back to the original section   afterwards.  */#define SWITCH_TO_SECTION_FUNCTION 				\void switch_to_section PARAMS ((enum in_section, tree));        \void 								\switch_to_section (section, decl) 				\     enum in_section section; 					\     tree decl; 						\{ 								\  switch (section) 						\    { 								\      case in_text: text_section (); break; 			\      case in_data: data_section (); break; 			\      case in_named: named_section (decl, NULL, 0); break; 	\      case in_drectve: drectve_section (); break; 		\      default: abort (); break; 				\    } 								\

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -