From: Aleksandar Ristovski <ARistovski@qnx.com>
To: Aleksandar Ristovski <ARistovski@qnx.com>, gdb-patches@sourceware.org
Cc: Daniel Jacobowitz <drow@false.org>,
Joel Brobecker <brobecker@adacore.com>,
Ryan Mansfield <RMansfield@qnx.com>
Subject: RE: [patch] IS_ABSOLUTE_PATH to handle both DOS and POSIX path st yles
Date: Fri, 04 Jan 2008 19:26:00 -0000 [thread overview]
Message-ID: <2F6320727174C448A52CEB63D85D11F40A4C@nova.ott.qnx.com> (raw)
Oops... the patch I submitted has a few typos. Sorry about that. Here is the
correct one.
This patch introduces new IS_DIR_SEPARATOR_? And IS_ABSOLUTE_PATH_? Macros.
Old macros IS_DIR_SEPARATOR and IS_ABSOLUTE_PATH continue to be configured
host dependent.
Please see http://sourceware.org/ml/gdb/2008-01/msg00021.html for details on
why this patch.
---
Aleksandar Ristovski
QNX Software Systems
ChangeLog:
2008-01-04 Aleksandar Ristovski <aristovski@qnx.com>
* filenames.h (IS_DIR_SEPARATOR_DOS): New macro.
(IS_ABSOLUTE_PATH_DOS): New macro.
(IS_DIR_SEPARATOR_X): New macro.
(IS_ABSOLUTE_PATH_X): New macro.
(IS_DIR_SEPARATOR_ANY): New macro.
(IS_ABSOLUTE_PATH_ANY): New macro.
Index: include/filenames.h
===================================================================
RCS file: /cvs/src/src/include/filenames.h,v
retrieving revision 1.4
diff -u -3 -p -r1.4 filenames.h
--- include/filenames.h 29 Mar 2007 21:03:43 -0000 1.4
+++ include/filenames.h 4 Jan 2008 19:22:02 -0000
@@ -26,6 +26,23 @@ Foundation, Inc., 51 Franklin Street - F
#ifndef FILENAMES_H
#define FILENAMES_H
+/* For DOS style paths. Note that these macros do not recognize
+ path starting with '/' as an absolute path. */
+
+#define IS_DIR_SEPARATOR_DOS(c) ((c) == '/' || (c) == '\\')
+#define IS_ABSOLUTE_PATH_DOS(f) (((f)[0]) && ((f)[1] == ':'))
+
+/* For POSIX style paths. */
+
+#define IS_DIR_SEPARATOR_X(c) ((c) == '/')
+#define IS_ABSOLUTE_PATH_X(f) (IS_DIR_SEPARATOR_X((f)[0]))
+
+/* Universal macros, to be used on paths that could be either
+ POSIX or DOS. */
+
+#define IS_DIR_SEPARATOR_ANY(c) (IS_DIR_SEPARATOR_DOS(c))
+#define IS_ABSOLUTE_PATH_ANY(f) (IS_ABSOLUTE_PATH_X(f) ||
IS_ABSOLUTE_PATH_DOS(f))
+
#if defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__) || defined
(__CYGWIN__)
#ifndef HAVE_DOS_BASED_FILE_SYSTEM
next reply other threads:[~2008-01-04 19:26 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-04 19:26 Aleksandar Ristovski [this message]
2008-01-04 19:33 ` Daniel Jacobowitz
[not found] <2F6320727174C448A52CEB63D85D11F40A58@nova.ott.qnx.com>
[not found] ` <20080106054030.GA10410@caradoc.them.org>
2008-01-06 19:38 ` Eli Zaretskii
2008-01-06 20:03 ` Doug Evans
2008-01-06 20:18 ` Eli Zaretskii
2008-01-06 21:07 ` Doug Evans
2008-01-07 3:40 ` Daniel Jacobowitz
2008-01-07 4:21 ` Eli Zaretskii
2008-01-07 13:17 ` Daniel Jacobowitz
2008-01-07 21:28 ` Eli Zaretskii
2008-01-07 4:18 ` Eli Zaretskii
2008-01-07 17:36 ` Doug Evans
2008-01-07 21:32 ` Eli Zaretskii
2008-01-07 21:36 ` Daniel Jacobowitz
2008-01-08 4:25 ` Eli Zaretskii
2008-01-08 13:47 ` Daniel Jacobowitz
2008-01-09 16:13 Aleksandar Ristovski
2008-01-09 19:10 ` Eli Zaretskii
2008-01-09 19:43 ` Daniel Jacobowitz
2008-01-10 4:13 ` Eli Zaretskii
2008-01-10 14:01 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2F6320727174C448A52CEB63D85D11F40A4C@nova.ott.qnx.com \
--to=aristovski@qnx.com \
--cc=RMansfield@qnx.com \
--cc=brobecker@adacore.com \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox