*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / source.c
index e2b6fa90f67a7db725c0d6dbb9e20705a4f2a330..34ed01c270ec3d11b630eda65b4f458e19d3d12f 100644 (file)
 #include "ui-out.h"
 #include "readline/readline.h"
 
-#ifdef CRLF_SOURCE_FILES
-
-/* Define CRLF_SOURCE_FILES in an xm-*.h file if source files on the
-   host use \r\n rather than just \n.  Defining CRLF_SOURCE_FILES is
-   much faster than defining LSEEK_NOT_LINEAR.  */
-
 #ifndef O_BINARY
 #define O_BINARY 0
 #endif
 #define OPEN_MODE (O_RDONLY | O_BINARY)
 #define FDOPEN_MODE FOPEN_RB
 
-#else /* ! defined (CRLF_SOURCE_FILES) */
-
-#define OPEN_MODE O_RDONLY
-#define FDOPEN_MODE FOPEN_RT
-
-#endif /* ! defined (CRLF_SOURCE_FILES) */
-
 /* Prototypes for exported functions. */
 
 void _initialize_source (void);
@@ -674,9 +661,7 @@ openp (const char *path, int opts, const char *string,
   if (!path)
     path = ".";
 
-#if defined(_WIN32) || defined(__CYGWIN__)
   mode |= O_BINARY;
-#endif
 
   if ((opts & OPF_TRY_CWD_FIRST) || IS_ABSOLUTE_PATH (string))
     {
@@ -1265,7 +1250,6 @@ print_source_lines_base (struct symtab *s, int line, int stopline, int noerror)
            }
          else if (c == 0177)
            ui_out_text (uiout, "^?");
-#ifdef CRLF_SOURCE_FILES
          else if (c == '\r')
            {
              /* Skip a \r character, but only before a \n.  */
@@ -1276,7 +1260,6 @@ print_source_lines_base (struct symtab *s, int line, int stopline, int noerror)
              if (c1 != EOF)
                ungetc (c1, stream);
            }
-#endif
          else
            {
              sprintf (buf, "%c", c);
@@ -1464,7 +1447,6 @@ forward_search_command (char *regex, int from_tty)
        }
       while (c != '\n' && (c = getc (stream)) >= 0);
 
-#ifdef CRLF_SOURCE_FILES
       /* Remove the \r, if any, at the end of the line, otherwise
          regular expressions that end with $ or \n won't work.  */
       if (p - buf > 1 && p[-2] == '\r')
@@ -1472,7 +1454,6 @@ forward_search_command (char *regex, int from_tty)
          p--;
          p[-1] = '\n';
        }
-#endif
 
       /* we now have a source line in buf, null terminate and match */
       *p = 0;
@@ -1548,7 +1529,6 @@ reverse_search_command (char *regex, int from_tty)
        }
       while (c != '\n' && (c = getc (stream)) >= 0);
 
-#ifdef CRLF_SOURCE_FILES
       /* Remove the \r, if any, at the end of the line, otherwise
          regular expressions that end with $ or \n won't work.  */
       if (p - buf > 1 && p[-2] == '\r')
@@ -1556,7 +1536,6 @@ reverse_search_command (char *regex, int from_tty)
          p--;
          p[-1] = '\n';
        }
-#endif
 
       /* We now have a source line in buf; null terminate and match.  */
       *p = 0;
This page took 0.032277 seconds and 4 git commands to generate.