File: i386-uint64_msbit.patch

package info (click to toggle)
ncbi-vdb 3.2.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 42,776 kB
  • sloc: ansic: 304,815; cpp: 75,250; python: 5,402; perl: 3,438; yacc: 2,225; sh: 689; lex: 574; makefile: 428; xml: 4
file content (26 lines) | stat: -rw-r--r-- 842 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Description: add missing implementation of uint64_msbit for i386
 Without this definition, we get a "successful" library build with undefined
 symbols on i386.  We can use the same implementation of this function as on
 x86_64.
Author: Steve Langasek <steve.langasek@ubuntu.com>
Last-Modified: 2018-08-26
Bug-Debian: https://bugs.debian.org/907358

Index: ncbi-vdb/interfaces/cc/gcc/i386/arch-impl.h
===================================================================
--- ncbi-vdb.orig/interfaces/cc/gcc/i386/arch-impl.h
+++ ncbi-vdb/interfaces/cc/gcc/i386/arch-impl.h
@@ -75,6 +75,13 @@ int32_t uint32_msbit ( uint32_t self )
     return -1;
 }
 
+static __inline__
+int32_t uint64_msbit ( uint64_t self )
+{
+    if (self==0) return -1;
+    return 63 - __builtin_clzll ( self );
+}
+
 typedef struct int128_t int128_t;
 struct int128_t
 {