[PATCH] D68033: [llvm-ar] Make paths case insensitive when on windows

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 30 04:37:03 PDT 2019


MaskRay added a comment.

I hope we can avoid case insensitiveness whenever possible, so can you talk about your use case?

  // binutils-gdb/include/filenames.h
  #if defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__) || defined (__CYGWIN__)
  #  ifndef HAVE_DOS_BASED_FILE_SYSTEM
  #    define HAVE_DOS_BASED_FILE_SYSTEM 1
  #  endif
  #  ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM
  #    define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1
  #  endif
  
  // libiberty/filename_cmp.c
  int
  filename_cmp (const char *s1, const char *s2)
  {
  #if !defined(HAVE_DOS_BASED_FILE_SYSTEM) \
      && !defined(HAVE_CASE_INSENSITIVE_FILE_SYSTEM)
    return strcmp(s1, s2);
  #else
    for (;;)
      {
        int c1 = *s1;
        int c2 = *s2;
  
  #if defined (HAVE_CASE_INSENSITIVE_FILE_SYSTEM)
        c1 = TOLOWER (c1);  ///// POSIX/C locale case mapping, locale agnostic
        c2 = TOLOWER (c2);
  #endif
  ...

Quoting //Per-directory case sensitivity and WSL//:

> Applications can pass the FILE_FLAG_POSIX_SEMANTICS flag to the CreateFile API to indicate that they want the path to be treated as case sensitive.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68033/new/

https://reviews.llvm.org/D68033





More information about the llvm-commits mailing list