patch by Jeffrey Yasskin for porting to Ubuntu Hardy.  Everything was accepted except there were some bug fixes needed in <locale> for the __nolocale_* series.  For the apple branch I ended up using templates instead of the var_args solution because it seemed both safer and more efficient.

llvm-svn: 104516
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 128ba7191da78d948b72b9c7adddc37002b391ef
diff --git a/src/ios.cpp b/src/ios.cpp
index 3bf3cbc..4d1261e 100644
--- a/src/ios.cpp
+++ b/src/ios.cpp
@@ -106,7 +106,11 @@
 string
 __iostream_category::message(int ev) const
 {
-    if (ev != static_cast<int>(io_errc::stream) && ev <= ELAST)
+    if (ev != static_cast<int>(io_errc::stream)
+#ifdef ELAST
+        && ev <= ELAST
+#endif
+        )
         return __do_message::message(ev);
     return string("unspecified iostream_category error");
 }