From 5877c21436816ced9dfc1abade6a9e81c9edb230 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 12 Jan 2015 16:20:24 -0800 Subject: [PATCH] Remove HAVE_SYMLINKS. Change-Id: I685357292af45a048439f0df0ae45f513479841a --- .../include/arch/darwin-x86/AndroidConfig.h | 6 ---- .../include/arch/linux-arm/AndroidConfig.h | 6 ---- .../include/arch/linux-arm64/AndroidConfig.h | 6 ---- .../include/arch/linux-mips/AndroidConfig.h | 6 ---- .../include/arch/linux-mips64/AndroidConfig.h | 6 ---- .../include/arch/linux-x86/AndroidConfig.h | 6 ---- .../arch/target_linux-x86/AndroidConfig.h | 6 ---- libs/host/CopyFile.c | 13 +++---- libs/host/list.java | 35 ------------------- 9 files changed, 7 insertions(+), 83 deletions(-) delete mode 100644 libs/host/list.java diff --git a/core/combo/include/arch/darwin-x86/AndroidConfig.h b/core/combo/include/arch/darwin-x86/AndroidConfig.h index 269798523..d8f33cb04 100644 --- a/core/combo/include/arch/darwin-x86/AndroidConfig.h +++ b/core/combo/include/arch/darwin-x86/AndroidConfig.h @@ -41,12 +41,6 @@ */ #define HAVE_PTHREADS -/* - * Define this if your platforms implements symbolic links - * in its filesystems - */ -#define HAVE_SYMLINKS - /* * Add any extra platform-specific defines here. */ diff --git a/core/combo/include/arch/linux-arm/AndroidConfig.h b/core/combo/include/arch/linux-arm/AndroidConfig.h index d826c27b9..77c165e6a 100644 --- a/core/combo/include/arch/linux-arm/AndroidConfig.h +++ b/core/combo/include/arch/linux-arm/AndroidConfig.h @@ -41,12 +41,6 @@ */ #define HAVE_PTHREADS -/* - * Define this if your platforms implements symbolic links - * in its filesystems - */ -#define HAVE_SYMLINKS - /* * Define if we have header */ diff --git a/core/combo/include/arch/linux-arm64/AndroidConfig.h b/core/combo/include/arch/linux-arm64/AndroidConfig.h index 2530bb4ad..f89e833c2 100644 --- a/core/combo/include/arch/linux-arm64/AndroidConfig.h +++ b/core/combo/include/arch/linux-arm64/AndroidConfig.h @@ -41,12 +41,6 @@ */ #define HAVE_PTHREADS -/* - * Define this if your platforms implements symbolic links - * in its filesystems - */ -#define HAVE_SYMLINKS - /* * Define if we have header */ diff --git a/core/combo/include/arch/linux-mips/AndroidConfig.h b/core/combo/include/arch/linux-mips/AndroidConfig.h index 9b029e963..c67ec304a 100644 --- a/core/combo/include/arch/linux-mips/AndroidConfig.h +++ b/core/combo/include/arch/linux-mips/AndroidConfig.h @@ -46,12 +46,6 @@ */ /* #define HAVE_MS_C_RUNTIME */ -/* - * Define this if your platforms implements symbolic links - * in its filesystems - */ -#define HAVE_SYMLINKS - /* * Define if we have header */ diff --git a/core/combo/include/arch/linux-mips64/AndroidConfig.h b/core/combo/include/arch/linux-mips64/AndroidConfig.h index 3ed4e5d94..8ebbbfd99 100644 --- a/core/combo/include/arch/linux-mips64/AndroidConfig.h +++ b/core/combo/include/arch/linux-mips64/AndroidConfig.h @@ -41,12 +41,6 @@ */ #define HAVE_PTHREADS -/* - * Define this if your platforms implements symbolic links - * in its filesystems - */ -#define HAVE_SYMLINKS - /* * Define if we have header */ diff --git a/core/combo/include/arch/linux-x86/AndroidConfig.h b/core/combo/include/arch/linux-x86/AndroidConfig.h index 122a82a34..c6b02d0a6 100644 --- a/core/combo/include/arch/linux-x86/AndroidConfig.h +++ b/core/combo/include/arch/linux-x86/AndroidConfig.h @@ -41,12 +41,6 @@ */ #define HAVE_PTHREADS -/* - * Define this if your platforms implements symbolic links - * in its filesystems - */ -#define HAVE_SYMLINKS - /* * We need to choose between 32-bit and 64-bit off_t. All of our code should * agree on the same size. For desktop systems, use 64-bit values, diff --git a/core/combo/include/arch/target_linux-x86/AndroidConfig.h b/core/combo/include/arch/target_linux-x86/AndroidConfig.h index 13baf6ff9..e8c3b58df 100644 --- a/core/combo/include/arch/target_linux-x86/AndroidConfig.h +++ b/core/combo/include/arch/target_linux-x86/AndroidConfig.h @@ -27,12 +27,6 @@ */ #define HAVE_PTHREADS -/* - * Define this if your platforms implements symbolic links - * in its filesystems - */ -#define HAVE_SYMLINKS 1 - /* * Define if we have header */ diff --git a/libs/host/CopyFile.c b/libs/host/CopyFile.c index f0c8fe5b5..855a56534 100644 --- a/libs/host/CopyFile.c +++ b/libs/host/CopyFile.c @@ -28,8 +28,9 @@ # define mkdir(path,mode) _mkdir(path) #endif -#ifndef HAVE_SYMLINKS -# define lstat stat +#if defined(_WIN32) +# define S_ISLNK(s) 0 +# define lstat stat # ifndef EACCESS /* seems to be missing from the Mingw headers */ # define EACCESS 13 # endif @@ -337,7 +338,6 @@ static int copyRegular(const char* src, const char* dst, const struct stat* pSrc } -#ifdef HAVE_SYMLINKS /* * Copy a symlink. This only happens if we're in "no derefence" mode, * in which we copy the links rather than the files that are pointed at. @@ -346,6 +346,9 @@ static int copyRegular(const char* src, const char* dst, const struct stat* pSrc * we want to throw it out and replace it. If it's not a symlink, we * need to trash it so we can create one. */ +#if defined(_WIN32) +extern int copySymlink(const char* src, const char* dst, const struct stat* pSrcStat, unsigned int options) __attribute__((error("no symlinks on Windows"))); +#else static int copySymlink(const char* src, const char* dst, const struct stat* pSrcStat, unsigned int options) { struct stat dstStat; @@ -420,7 +423,7 @@ static int copySymlink(const char* src, const char* dst, const struct stat* pSrc return 0; } -#endif /* HAVE_SYMLINKS */ +#endif /* * Copy the contents of one directory to another. Both "src" and "dst" @@ -616,10 +619,8 @@ static int copyFileRecursive(const char* src, const char* dst, bool isCmdLine, u } else { retVal = copyDirectory(src, dst, &srcStat, options); } -#ifdef HAVE_SYMLINKS } else if (S_ISLNK(srcStat.st_mode)) { retVal = copySymlink(src, dst, &srcStat, options); -#endif } else if (S_ISREG(srcStat.st_mode)) { retVal = copyRegular(src, dst, &srcStat, options); } else { diff --git a/libs/host/list.java b/libs/host/list.java deleted file mode 100644 index 30546e3ae..000000000 --- a/libs/host/list.java +++ /dev/null @@ -1,35 +0,0 @@ -import java.io.*; - -public class list { - private static char nibble(int c) { - return (char)(c < 10 ? ('0' + c) : ('a' + (c-10))); - } - public static void main(String[] argv) - { - ByteArrayOutputStream stream = new ByteArrayOutputStream(100); - OutputStreamWriter writer = null; - try { - writer = new OutputStreamWriter(stream, "utf-8"); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(System.err); - } - - int n = Integer.parseInt(argv[1], 16); - try { - writer.write(n); - writer.close(); - } catch (IOException e) { - e.printStackTrace(System.err); - } - - byte[] array = stream.toByteArray(); - - System.out.print(" case '" + argv[0] + "': return \""); - for (int i=0; i> 4) & 0x0f) + nibble(b & 0xf)); - } - System.out.println("\";"); - } -} -