[med-svn] [htslib] 05/10: Fixes #531 from PR suggestions.

Andreas Tille tille at debian.org
Wed Jul 19 19:54:43 UTC 2017


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository htslib.

commit da5c0c7b9aa1710b70ceb2a1097101d1df1c115a
Author: James Bonfield <jkb at sanger.ac.uk>
Date:   Tue Jul 4 13:54:58 2017 +0100

    Fixes #531 from PR suggestions.
    
    - Fixed POSIX vs XOPEN macro mistake.
    - Sort order of Makefile.
    - Clearer logic of C:/path handling.
    - Removed fseeko from configure script and source ifdefs.
    
    NOT fixed in this update:
    
    - Removal of cram/os.h (to do later on and merge into hts_os.h).
    - Bgzip binary vs non-binary modes.  We need clearer understanding on
      this, and command line extensions if we wish to support both.
    - fdatasync reimplementation for systems that don't have it.
---
 Makefile     |  2 +-
 configure.ac |  2 +-
 cram/os.h    | 17 -----------------
 hfile.c      |  9 +++++----
 4 files changed, 7 insertions(+), 23 deletions(-)

diff --git a/Makefile b/Makefile
index da08cbf..6379d58 100644
--- a/Makefile
+++ b/Makefile
@@ -138,7 +138,6 @@ print-version:
 
 
 LIBHTS_OBJS = \
-	hts_os.o\
 	kfunc.o \
 	knetfile.o \
 	kstring.o \
@@ -149,6 +148,7 @@ LIBHTS_OBJS = \
 	hfile.o \
 	hfile_net.o \
 	hts.o \
+	hts_os.o\
 	md5.o \
 	multipart.o \
 	probaln.o \
diff --git a/configure.ac b/configure.ac
index 5cfffaa..ebedeef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -133,7 +133,7 @@ case $host_alias in
     # This also sets __USE_MINGW_ANSI_STDIO which in turn makes PRId64,
     # %lld and %z printf formats work.  It also enforces the snprintf to
     # be C99 compliant so it returns the correct values (in kstring.c).
-    CPPFLAGS="$CPPCFLAGS -D_POSIX_C_SOURCE=600"
+    CPPFLAGS="$CPPCFLAGS -D_XOPEN_SOURCE=600"
     ;;
   *)
     host_result="plain .so"
diff --git a/cram/os.h b/cram/os.h
index ad3d441..ba0a207 100644
--- a/cram/os.h
+++ b/cram/os.h
@@ -213,23 +213,6 @@ static inline uint16_t le_int2(uint16_t x) {
 #endif
 #endif
 
-/* Generic WIN32 API issues */
-#ifdef _WIN32
-#  ifndef HAVE_FSEEKO
-#    if __MSVCRT_VERSION__ >= 0x800
-       /* if you have MSVCR80 installed then you can use these definitions: */
-#      define off_t __int64
-#      define fseeko _fseeki64
-#      define ftello _ftelli64
-#    else
-       /* otherwise we're stuck with 32-bit file support */
-#      define off_t long
-#      define fseeko fseek
-#      define ftello ftell
-#    endif
-#  endif /* !HAVE_FSEEKO */
-#endif /* _WIN32 */
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/hfile.c b/hfile.c
index ce0899e..b0c5eba 100644
--- a/hfile.c
+++ b/hfile.c
@@ -629,13 +629,14 @@ hFILE *hdopen(int fd, const char *mode)
 static hFILE *hopen_fd_fileuri(const char *url, const char *mode)
 {
     if (strncmp(url, "file://localhost/", 17) == 0) url += 16;
-#ifdef _WIN32
-    else if (strncmp(url, "file:///", 8) == 0) url += 8;
-#else
     else if (strncmp(url, "file:///", 8) == 0) url += 7;
-#endif
     else { errno = EPROTONOSUPPORT; return NULL; }
 
+#ifdef _WIN32
+    // For cases like C:/foo
+    if (url[0] == '/' && url[2] == ':' && url[3] == '/') url++;
+#endif
+
     return hopen_fd(url, mode);
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/htslib.git



More information about the debian-med-commit mailing list