Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: services/files/c/mojio_sys_stat.h

Issue 1130873002: Enable //services/files/c:apptests on Android now that we have the C++11 library. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/files/c/lib/util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/files/c/mojio_sys_stat.h
diff --git a/services/files/c/mojio_sys_stat.h b/services/files/c/mojio_sys_stat.h
index 3d4498255a472728c198b9057616576426cc1cbe..2498afceb44a026b6e82d18d4bdbfca0f8a2948f 100644
--- a/services/files/c/mojio_sys_stat.h
+++ b/services/files/c/mojio_sys_stat.h
@@ -60,15 +60,19 @@
#define MOJIO_S_ISREG(mode) (((mode)&MOJIO_S_IFMT) == MOJIO_S_IFREG)
#define MOJIO_S_ISSOCK(mode) (((mode)&MOJIO_S_IFMT) == MOJIO_S_IFSOCK)
-// These are for backwards compatibility with older versions of POSIX. Since we
-// didn't prefix the names of the members in |struct mojio_stat| below, we don't
-// prefix these macro names either. This means that we'll collide with the
-// "real" <sys/stat.h>, but that should be fine as long as it follows
-// POSIX.1-2008 to the letter (since the macro definitions will be identical,
-// which is valid).
-#define st_atime st_atim.tv_sec
-#define st_mtime st_mtim.tv_sec
-#define st_ctime st_ctim.tv_sec
+// POSIX.1-2008 says we should define |st_atime| to |st_atim.tv_sec| (and
+// similarly for |st_mtime| and |st_ctime|). This is to provide (source)
+// backwards compatibility with older versions of POSIX.
+//
+// We could reasonably provide these macros on systems that are compliant with
+// POSIX.1-2008 (or later): even though they might collide with macro
+// definitions in the "real" <sys/stat.h>, it's okay since the macro definitions
+// will be identical. However, providing these macros on systems that aren't
+// POSIX.1-2008-compliant (like Android) leads to an intractable conflict. Thus
+// we provide prefixed macros instead.
+#define mojio_st_atime st_atim.tv_sec
+#define mojio_st_mtime st_mtim.tv_sec
+#define mojio_st_ctime st_ctim.tv_sec
// Types -----------------------------------------------------------------------
« no previous file with comments | « services/files/c/lib/util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698