[PATCH] D17676: Add some minimal portability code paths for PS4.

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 29 11:37:22 PST 2016


silvas updated this revision to Diff 49402.
silvas added a comment.

- Update for filcab's comments.


http://reviews.llvm.org/D17676

Files:
  lib/profile/InstrProfilingPort.h
  lib/profile/InstrProfilingUtil.h

Index: lib/profile/InstrProfilingUtil.h
===================================================================
--- lib/profile/InstrProfilingUtil.h
+++ lib/profile/InstrProfilingUtil.h
@@ -10,7 +10,14 @@
 #ifndef PROFILE_INSTRPROFILINGUTIL_H
 #define PROFILE_INSTRPROFILINGUTIL_H
 
+#include <stddef.h>
+
 /*! \brief Create a directory tree. */
 void __llvm_profile_recursive_mkdir(char *Pathname);
 
+/* PS4 doesn't have getenv. Define a shim. */
+#if __PS4__
+static inline char *getenv(const char *name) { return NULL; }
+#endif /* #if __PS4__ */
+
 #endif  /* PROFILE_INSTRPROFILINGUTIL_H */
Index: lib/profile/InstrProfilingPort.h
===================================================================
--- lib/profile/InstrProfilingPort.h
+++ lib/profile/InstrProfilingPort.h
@@ -25,6 +25,8 @@
 #define COMPILER_RT_MAX_HOSTLEN 128
 #ifdef _MSC_VER
 #define COMPILER_RT_GETHOSTNAME(Name, Len) gethostname(Name, Len)
+#elif defined(__PS4__)
+#define COMPILER_RT_GETHOSTNAME(Name, Len) (-1)
 #else
 #define COMPILER_RT_GETHOSTNAME(Name, Len) GetHostName(Name, Len)
 #define COMPILER_RT_HAS_UNAME 1


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17676.49402.patch
Type: text/x-patch
Size: 1094 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160229/2b54071a/attachment.bin>


More information about the llvm-commits mailing list