]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/libfreeimage/0005-Manage-powf64-with-glibc.patch
libfreeimage: fix build with glibc
[coffee/buildroot.git] / package / libfreeimage / 0005-Manage-powf64-with-glibc.patch
1 From d8f40eabb25953bff5d90017478dc59d586346d1 Mon Sep 17 00:00:00 2001
2 From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3 Date: Thu, 3 May 2018 15:44:14 +0200
4 Subject: [PATCH] Manage powf64 with glibc
5
6 powf64 is now included in latest version of glibc so rename powf64 into
7 powf_64
8
9 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
10 ---
11  Source/LibRawLite/dcraw/dcraw.c             | 108 ++++++++++++++--------------
12  Source/LibRawLite/internal/dcraw_common.cpp | 108 ++++++++++++++--------------
13  2 files changed, 108 insertions(+), 108 deletions(-)
14
15 diff --git a/Source/LibRawLite/dcraw/dcraw.c b/Source/LibRawLite/dcraw/dcraw.c
16 index 6bf607d..3e52cec 100644
17 --- a/Source/LibRawLite/dcraw/dcraw.c
18 +++ b/Source/LibRawLite/dcraw/dcraw.c
19 @@ -6727,7 +6727,7 @@ static float powf_lim(float a, float b, float limup)
20  {
21    return (b>limup || b < -limup)?0.f:powf(a,b);
22  }
23 -static float powf64(float a, float b)
24 +static float powf_64(float a, float b)
25  {
26    return powf_lim(a,b,64.f);
27  }
28 @@ -6764,7 +6764,7 @@ static float _CanonConvert2EV(short in)
29  static float _CanonConvertAperture(short in)
30  {
31    if (in == (short)0xffe0) return 0.0f;
32 -  else return powf64(2.0f, _CanonConvert2EV(in) / 2.0f);
33 +  else return powf_64(2.0f, _CanonConvert2EV(in) / 2.0f);
34  }
35  
36  void CLASS setCanonBodyFeatures (unsigned id)
37 @@ -7046,15 +7046,15 @@ void CLASS processNikonLensData (uchar *LensData, unsigned len)
38      imgdata.lens.nikon.NikonLensIDNumber = LensData[i];
39      imgdata.lens.nikon.NikonLensFStops = LensData[i + 1];
40      imgdata.lens.makernotes.LensFStops = (float)imgdata.lens.nikon.NikonLensFStops /12.0f;
41 -    imgdata.lens.makernotes.MinFocal = 5.0f * powf64(2.0f, (float)LensData[i + 2] / 24.0f);
42 -    imgdata.lens.makernotes.MaxFocal = 5.0f * powf64(2.0f, (float)LensData[i + 3] / 24.0f);
43 -    imgdata.lens.makernotes.MaxAp4MinFocal = powf64(2.0f, (float)LensData[i + 4] / 24.0f);
44 -    imgdata.lens.makernotes.MaxAp4MaxFocal = powf64(2.0f, (float)LensData[i + 5] / 24.0f);
45 +    imgdata.lens.makernotes.MinFocal = 5.0f * powf_64(2.0f, (float)LensData[i + 2] / 24.0f);
46 +    imgdata.lens.makernotes.MaxFocal = 5.0f * powf_64(2.0f, (float)LensData[i + 3] / 24.0f);
47 +    imgdata.lens.makernotes.MaxAp4MinFocal = powf_64(2.0f, (float)LensData[i + 4] / 24.0f);
48 +    imgdata.lens.makernotes.MaxAp4MaxFocal = powf_64(2.0f, (float)LensData[i + 5] / 24.0f);
49      imgdata.lens.nikon.NikonMCUVersion = LensData[i + 6];
50      if (i != 2)
51        {
52 -        imgdata.lens.makernotes.CurFocal = 5.0f * powf64(2.0f, (float)LensData[i - 1] / 24.0f);
53 -        imgdata.lens.nikon.NikonEffectiveMaxAp = powf64(2.0f, (float)LensData[i + 7] / 24.0f);
54 +        imgdata.lens.makernotes.CurFocal = 5.0f * powf_64(2.0f, (float)LensData[i - 1] / 24.0f);
55 +        imgdata.lens.nikon.NikonEffectiveMaxAp = powf_64(2.0f, (float)LensData[i + 7] / 24.0f);
56        }
57      imgdata.lens.makernotes.LensID =
58        (unsigned long long) LensData[i] << 56 |
59 @@ -7563,11 +7563,11 @@ void CLASS process_Sony_0x9050 (uchar * buf, unsigned id)
60      {
61        if (buf[0])
62          imgdata.lens.makernotes.MaxAp =
63 -          my_roundf(powf64(2.0f, ((float)SonySubstitution[buf[0]] / 8.0 - 1.06f) / 2.0f)*10.0f) / 10.0f;
64 +          my_roundf(powf_64(2.0f, ((float)SonySubstitution[buf[0]] / 8.0 - 1.06f) / 2.0f)*10.0f) / 10.0f;
65  
66        if (buf[1])
67          imgdata.lens.makernotes.MinAp =
68 -          my_roundf(powf64(2.0f, ((float)SonySubstitution[buf[1]] / 8.0 - 1.06f) / 2.0f)*10.0f) / 10.0f;
69 +          my_roundf(powf_64(2.0f, ((float)SonySubstitution[buf[1]] / 8.0 - 1.06f) / 2.0f)*10.0f) / 10.0f;
70      }
71  
72    if (imgdata.lens.makernotes.CameraMount != LIBRAW_MOUNT_FixedLens)
73 @@ -7577,7 +7577,7 @@ void CLASS process_Sony_0x9050 (uchar * buf, unsigned id)
74            lid = SonySubstitution[buf[0x3d]] << 8 |
75              SonySubstitution[buf[0x3c]];
76            imgdata.lens.makernotes.CurAp =
77 -            powf64(2.0f, ((float)lid/256.0f - 16.0f) / 2.0f);
78 +            powf_64(2.0f, ((float)lid/256.0f - 16.0f) / 2.0f);
79          }
80        if (buf[0x105] && (imgdata.lens.makernotes.LensMount != LIBRAW_MOUNT_Canon_EF))
81          imgdata.lens.makernotes.LensMount =
82 @@ -7957,7 +7957,7 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer)
83            {
84              unsigned char cc;
85              fread(&cc, 1, 1, ifp);
86 -            iso_speed = (int)(100.0 * powf64(2.0, (double)(cc) / 12.0 - 5.0));
87 +            iso_speed = (int)(100.0 * powf_64(2.0, (double)(cc) / 12.0 - 5.0));
88              break;
89            }
90        }
91 @@ -7989,7 +7989,7 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer)
92            }
93            break;
94          case 0x1002:
95 -          imgdata.lens.makernotes.CurAp = powf64(2.0f, getreal(type)/2);
96 +          imgdata.lens.makernotes.CurAp = powf_64(2.0f, getreal(type)/2);
97            break;
98          case 0x20100201:
99            imgdata.lens.makernotes.LensID =
100 @@ -8009,10 +8009,10 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer)
101            fread(imgdata.lens.makernotes.Lens, len, 1, ifp);
102            break;
103          case 0x20100205:
104 -          imgdata.lens.makernotes.MaxAp4MinFocal = powf64(sqrt(2.0f), get2() / 256.0f);
105 +          imgdata.lens.makernotes.MaxAp4MinFocal = powf_64(sqrt(2.0f), get2() / 256.0f);
106            break;
107          case 0x20100206:
108 -          imgdata.lens.makernotes.MaxAp4MaxFocal = powf64(sqrt(2.0f), get2() / 256.0f);
109 +          imgdata.lens.makernotes.MaxAp4MaxFocal = powf_64(sqrt(2.0f), get2() / 256.0f);
110            break;
111          case 0x20100207:
112            imgdata.lens.makernotes.MinFocal = (float)get2();
113 @@ -8023,7 +8023,7 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer)
114              imgdata.lens.makernotes.MaxFocal = imgdata.lens.makernotes.MinFocal;
115            break;
116          case 0x2010020a:
117 -          imgdata.lens.makernotes.MaxAp4CurFocal = powf64(sqrt(2.0f), get2() / 256.0f);
118 +          imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(sqrt(2.0f), get2() / 256.0f);
119            break;
120          case 0x20100301:
121            imgdata.lens.makernotes.TeleconverterID = fgetc(ifp) << 8;
122 @@ -8121,13 +8121,13 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer)
123                  if (table_buf[iLensData+9] &&
124                      (fabs(imgdata.lens.makernotes.CurFocal) < 0.1f))
125                    imgdata.lens.makernotes.CurFocal =
126 -                    10*(table_buf[iLensData+9]>>2) * powf64(4, (table_buf[iLensData+9] & 0x03)-2);
127 +                    10*(table_buf[iLensData+9]>>2) * powf_64(4, (table_buf[iLensData+9] & 0x03)-2);
128                  if (table_buf[iLensData+10] & 0xf0)
129                    imgdata.lens.makernotes.MaxAp4CurFocal =
130 -                    powf64(2.0f, (float)((table_buf[iLensData+10] & 0xf0) >>4)/4.0f);
131 +                    powf_64(2.0f, (float)((table_buf[iLensData+10] & 0xf0) >>4)/4.0f);
132                  if (table_buf[iLensData+10] & 0x0f)
133                    imgdata.lens.makernotes.MinAp4CurFocal =
134 -                    powf64(2.0f, (float)((table_buf[iLensData+10] & 0x0f) + 10)/4.0f);
135 +                    powf_64(2.0f, (float)((table_buf[iLensData+10] & 0x0f) + 10)/4.0f);
136                  if (
137                      (imgdata.lens.makernotes.CamID != 0x12e6c) &&      // K-r
138                      (imgdata.lens.makernotes.CamID != 0x12e76) &&      // K-5
139 @@ -8148,14 +8148,14 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer)
140                      if ((table_buf[iLensData+14] > 1) &&
141                          (fabs(imgdata.lens.makernotes.MaxAp4CurFocal) < 0.7f))
142                        imgdata.lens.makernotes.MaxAp4CurFocal =
143 -                        powf64(2.0f, (float)((table_buf[iLensData+14] & 0x7f) -1)/32.0f);
144 +                        powf_64(2.0f, (float)((table_buf[iLensData+14] & 0x7f) -1)/32.0f);
145                    }
146                  else if ((imgdata.lens.makernotes.CamID != 0x12e76) && // K-5
147                           (table_buf[iLensData+15] > 1) &&
148                           (fabs(imgdata.lens.makernotes.MaxAp4CurFocal) < 0.7f))
149                    {
150                      imgdata.lens.makernotes.MaxAp4CurFocal =
151 -                      powf64(2.0f, (float)((table_buf[iLensData+15] & 0x7f) -1)/32.0f);
152 +                      powf_64(2.0f, (float)((table_buf[iLensData+15] & 0x7f) -1)/32.0f);
153                    }
154                }
155              free(table_buf);
156 @@ -8321,7 +8321,7 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer)
157                    lid = (((ushort)table_buf[2])<<8) |
158                      ((ushort)table_buf[3]);
159                    imgdata.lens.makernotes.CurAp =
160 -                    powf64(2.0f, ((float)lid/8.0f-1.0f)/2.0f);
161 +                    powf_64(2.0f, ((float)lid/8.0f-1.0f)/2.0f);
162                  }
163                break;
164              case 1536:
165 @@ -8801,7 +8801,7 @@ void CLASS parse_makernote (int base, int uptag)
166            }
167            break;
168          case 0x1002:
169 -          imgdata.lens.makernotes.CurAp = powf64(2.0f, getreal(type)/2);
170 +          imgdata.lens.makernotes.CurAp = powf_64(2.0f, getreal(type)/2);
171            break;
172          case 0x20100201:
173            imgdata.lens.makernotes.LensID =
174 @@ -8821,10 +8821,10 @@ void CLASS parse_makernote (int base, int uptag)
175            fread(imgdata.lens.makernotes.Lens, len, 1, ifp);
176            break;
177          case 0x20100205:
178 -          imgdata.lens.makernotes.MaxAp4MinFocal = powf64(sqrt(2.0f), get2() / 256.0f);
179 +          imgdata.lens.makernotes.MaxAp4MinFocal = powf_64(sqrt(2.0f), get2() / 256.0f);
180            break;
181          case 0x20100206:
182 -          imgdata.lens.makernotes.MaxAp4MaxFocal = powf64(sqrt(2.0f), get2() / 256.0f);
183 +          imgdata.lens.makernotes.MaxAp4MaxFocal = powf_64(sqrt(2.0f), get2() / 256.0f);
184            break;
185          case 0x20100207:
186            imgdata.lens.makernotes.MinFocal = (float)get2();
187 @@ -8835,7 +8835,7 @@ void CLASS parse_makernote (int base, int uptag)
188              imgdata.lens.makernotes.MaxFocal = imgdata.lens.makernotes.MinFocal;
189            break;
190          case 0x2010020a:
191 -          imgdata.lens.makernotes.MaxAp4CurFocal = powf64(sqrt(2.0f), get2() / 256.0f);
192 +          imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(sqrt(2.0f), get2() / 256.0f);
193            break;
194          case 0x20100301:
195            imgdata.lens.makernotes.TeleconverterID = fgetc(ifp) << 8;
196 @@ -8993,13 +8993,13 @@ void CLASS parse_makernote (int base, int uptag)
197                {
198                  if (table_buf[iLensData+9] && (fabs(imgdata.lens.makernotes.CurFocal) < 0.1f))
199                    imgdata.lens.makernotes.CurFocal =
200 -                    10*(table_buf[iLensData+9]>>2) * powf64(4, (table_buf[iLensData+9] & 0x03)-2);
201 +                    10*(table_buf[iLensData+9]>>2) * powf_64(4, (table_buf[iLensData+9] & 0x03)-2);
202                  if (table_buf[iLensData+10] & 0xf0)
203                    imgdata.lens.makernotes.MaxAp4CurFocal =
204 -                    powf64(2.0f, (float)((table_buf[iLensData+10] & 0xf0) >>4)/4.0f);
205 +                    powf_64(2.0f, (float)((table_buf[iLensData+10] & 0xf0) >>4)/4.0f);
206                  if (table_buf[iLensData+10] & 0x0f)
207                    imgdata.lens.makernotes.MinAp4CurFocal =
208 -                    powf64(2.0f, (float)((table_buf[iLensData+10] & 0x0f) + 10)/4.0f);
209 +                    powf_64(2.0f, (float)((table_buf[iLensData+10] & 0x0f) + 10)/4.0f);
210                  if (
211                      (imgdata.lens.makernotes.CamID != 0x12e6c) &&      // K-r
212                      (imgdata.lens.makernotes.CamID != 0x12e76) &&      // K-5
213 @@ -9020,14 +9020,14 @@ void CLASS parse_makernote (int base, int uptag)
214                      if ((table_buf[iLensData+14] > 1) &&
215                          (fabs(imgdata.lens.makernotes.MaxAp4CurFocal) < 0.7f))
216                        imgdata.lens.makernotes.MaxAp4CurFocal =
217 -                        powf64(2.0f, (float)((table_buf[iLensData+14] & 0x7f) -1)/32.0f);
218 +                        powf_64(2.0f, (float)((table_buf[iLensData+14] & 0x7f) -1)/32.0f);
219                    }
220                  else if ((imgdata.lens.makernotes.CamID != 0x12e76) && // K-5
221                           (table_buf[iLensData+15] > 1) &&
222                           (fabs(imgdata.lens.makernotes.MaxAp4CurFocal) < 0.7f))
223                    {
224                      imgdata.lens.makernotes.MaxAp4CurFocal =
225 -                      powf64(2.0f, (float)((table_buf[iLensData+15] & 0x7f) -1)/32.0f);
226 +                      powf_64(2.0f, (float)((table_buf[iLensData+15] & 0x7f) -1)/32.0f);
227                    }
228                }
229              free(table_buf);
230 @@ -9188,7 +9188,7 @@ void CLASS parse_makernote (int base, int uptag)
231                    lid = (((ushort)table_buf[2])<<8) |
232                      ((ushort)table_buf[3]);
233                    imgdata.lens.makernotes.CurAp =
234 -                    powf64(2.0f, ((float)lid/8.0f-1.0f)/2.0f);
235 +                    powf_64(2.0f, ((float)lid/8.0f-1.0f)/2.0f);
236                  }
237                break;
238              case 1536:
239 @@ -9273,15 +9273,15 @@ void CLASS parse_makernote (int base, int uptag)
240        {
241          unsigned char cc;
242          fread(&cc,1,1,ifp);
243 -        iso_speed = int(100.0 * powf64(2.0f,float(cc)/12.0-5.0));
244 +        iso_speed = int(100.0 * powf_64(2.0f,float(cc)/12.0-5.0));
245        }
246      if (tag == 4 && len > 26 && len < 35) {
247        if ((i=(get4(),get2())) != 0x7fff && (!iso_speed || iso_speed == 65535))
248 -       iso_speed = 50 * powf64(2.0, i/32.0 - 4);
249 +       iso_speed = 50 * powf_64(2.0, i/32.0 - 4);
250        if ((i=(get2(),get2())) != 0x7fff && !aperture)
251 -       aperture = powf64(2.0, i/64.0);
252 +       aperture = powf_64(2.0, i/64.0);
253        if ((i=get2()) != 0xffff && !shutter)
254 -       shutter = powf64(2.0, (short) i/-32.0);
255 +       shutter = powf_64(2.0, (short) i/-32.0);
256        wbi = (get2(),get2());
257        shot_order = (get2(),get2());
258      }
259 @@ -9732,7 +9732,7 @@ void CLASS parse_exif (int base)
260          imgdata.lens.Lens[0] = 0;
261        break;
262      case 0x9205:
263 -      imgdata.lens.EXIF_MaxAp = powf64(2.0f, (getreal(type) / 2.0f));
264 +      imgdata.lens.EXIF_MaxAp = powf_64(2.0f, (getreal(type) / 2.0f));
265        break;
266  #endif
267        case 33434:  shutter = getreal(type);            break;
268 @@ -9745,10 +9745,10 @@ void CLASS parse_exif (int base)
269        case 36867:
270        case 36868:  get_timestamp(0);                   break;
271        case 37377:  if ((expo = -getreal(type)) < 128 && shutter == 0.)
272 -          shutter = powf64(2.0, expo);         break;
273 +          shutter = powf_64(2.0, expo);                break;
274        case 37378:
275          if (fabs(ape = getreal(type))<256.0)
276 -          aperture = powf64(2.0, ape/2);
277 +          aperture = powf_64(2.0, ape/2);
278          break;
279        case 37385:  flash_used = getreal(type);          break;
280        case 37386:  focal_len = getreal(type);          break;
281 @@ -10361,7 +10361,7 @@ int CLASS parse_tiff_ifd (int base)
282          imgdata.lens.Lens[0] = 0;
283        break;
284      case 0x9205:
285 -                               imgdata.lens.EXIF_MaxAp = powf64(2.0f, (getreal(type) / 2.0f));
286 +                               imgdata.lens.EXIF_MaxAp = powf_64(2.0f, (getreal(type) / 2.0f));
287        break;
288  // IB end
289  #endif
290 @@ -11130,22 +11130,22 @@ void CLASS parse_ciff (int offset, int length, int depth)
291        thumb_length = len;
292      }
293      if (type == 0x1818) {
294 -      shutter = powf64(2.0f, -int_to_float((get4(),get4())));
295 -      aperture = powf64(2.0f, int_to_float(get4())/2);
296 +      shutter = powf_64(2.0f, -int_to_float((get4(),get4())));
297 +      aperture = powf_64(2.0f, int_to_float(get4())/2);
298  #ifdef LIBRAW_LIBRARY_BUILD
299                         imgdata.lens.makernotes.CurAp = aperture;
300  #endif
301      }
302      if (type == 0x102a) {
303                         //      iso_speed = pow (2.0, (get4(),get2())/32.0 - 4) * 50;
304 -      iso_speed = powf64(2.0f, ((get2(),get2()) + get2())/32.0f - 5.0f) * 100.0f;
305 +      iso_speed = powf_64(2.0f, ((get2(),get2()) + get2())/32.0f - 5.0f) * 100.0f;
306  #ifdef LIBRAW_LIBRARY_BUILD
307        aperture  = _CanonConvertAperture((get2(),get2()));
308        imgdata.lens.makernotes.CurAp = aperture;
309  #else
310 -      aperture  = powf64(2.0, (get2(),(short)get2())/64.0);
311 +      aperture  = powf_64(2.0, (get2(),(short)get2())/64.0);
312  #endif
313 -      shutter   = powf64(2.0,-((short)get2())/32.0);
314 +      shutter   = powf_64(2.0,-((short)get2())/32.0);
315        wbi = (get2(),get2());
316        if (wbi > 17) wbi = 0;
317        fseek (ifp, 32, SEEK_CUR);
318 @@ -11349,8 +11349,8 @@ void CLASS parse_phase_one (int base)
319        setPhaseOneFeatures(unique_id);
320        break;
321      case 0x0401:
322 -      if (type == 4) imgdata.lens.makernotes.CurAp =  powf64(2.0f, (int_to_float(data)/2.0f));
323 -      else imgdata.lens.makernotes.CurAp = powf64(2.0f, (getreal(type)/2.0f));
324 +      if (type == 4) imgdata.lens.makernotes.CurAp =  powf_64(2.0f, (int_to_float(data)/2.0f));
325 +      else imgdata.lens.makernotes.CurAp = powf_64(2.0f, (getreal(type)/2.0f));
326        break;
327      case 0x0403:
328        if (type == 4) imgdata.lens.makernotes.CurFocal =  int_to_float(data);
329 @@ -11364,16 +11364,16 @@ void CLASS parse_phase_one (int base)
330        break;
331      case 0x0414:
332        if (type == 4) {
333 -       imgdata.lens.makernotes.MaxAp4CurFocal = powf64(2.0f, (int_to_float(data)/2.0f));
334 +       imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(2.0f, (int_to_float(data)/2.0f));
335        } else {
336 -        imgdata.lens.makernotes.MaxAp4CurFocal = powf64(2.0f, (getreal(type) / 2.0f));
337 +        imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(2.0f, (getreal(type) / 2.0f));
338        }
339        break;
340      case 0x0415:
341        if (type == 4) {
342 -       imgdata.lens.makernotes.MinAp4CurFocal = powf64(2.0f, (int_to_float(data)/2.0f));
343 +       imgdata.lens.makernotes.MinAp4CurFocal = powf_64(2.0f, (int_to_float(data)/2.0f));
344        } else {
345 -        imgdata.lens.makernotes.MinAp4CurFocal = powf64(2.0f, (getreal(type) / 2.0f));
346 +        imgdata.lens.makernotes.MinAp4CurFocal = powf_64(2.0f, (getreal(type) / 2.0f));
347        }
348        break;
349      case 0x0416:
350 @@ -13324,15 +13324,15 @@ void CLASS identify()
351        case 18: iso_speed = 320; break;
352        case 19: iso_speed = 400; break;
353      }
354 -    shutter = powf64(2.0f, (((float)get4())/8.0f)) / 16000.0f;
355 +    shutter = powf_64(2.0f, (((float)get4())/8.0f)) / 16000.0f;
356      FORC4 cam_mul[c ^ (c >> 1)] = get4();
357      fseek (ifp, 88, SEEK_SET);
358 -    aperture = powf64(2.0f, ((float)get4())/16.0f);
359 +    aperture = powf_64(2.0f, ((float)get4())/16.0f);
360      fseek (ifp, 112, SEEK_SET);
361      focal_len = get4();
362  #ifdef LIBRAW_LIBRARY_BUILD
363      fseek (ifp, 104, SEEK_SET);
364 -    imgdata.lens.makernotes.MaxAp4CurFocal = powf64(2.0f, ((float)get4())/16.0f);
365 +    imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(2.0f, ((float)get4())/16.0f);
366      fseek (ifp, 124, SEEK_SET);
367      fread(imgdata.lens.makernotes.Lens, 32, 1, ifp);
368      imgdata.lens.makernotes.CameraMount = LIBRAW_MOUNT_Contax_N;
369 diff --git a/Source/LibRawLite/internal/dcraw_common.cpp b/Source/LibRawLite/internal/dcraw_common.cpp
370 index a936a93..0fc4d81 100644
371 --- a/Source/LibRawLite/internal/dcraw_common.cpp
372 +++ b/Source/LibRawLite/internal/dcraw_common.cpp
373 @@ -5543,7 +5543,7 @@ static float powf_lim(float a, float b, float limup)
374  {
375    return (b>limup || b < -limup)?0.f:powf(a,b);
376  }
377 -static float powf64(float a, float b)
378 +static float powf_64(float a, float b)
379  {
380    return powf_lim(a,b,64.f);
381  }
382 @@ -5580,7 +5580,7 @@ static float _CanonConvert2EV(short in)
383  static float _CanonConvertAperture(short in)
384  {
385    if (in == (short)0xffe0) return 0.0f;
386 -  else return powf64(2.0f, _CanonConvert2EV(in) / 2.0f);
387 +  else return powf_64(2.0f, _CanonConvert2EV(in) / 2.0f);
388  }
389  
390  void CLASS setCanonBodyFeatures (unsigned id)
391 @@ -5862,15 +5862,15 @@ void CLASS processNikonLensData (uchar *LensData, unsigned len)
392      imgdata.lens.nikon.NikonLensIDNumber = LensData[i];
393      imgdata.lens.nikon.NikonLensFStops = LensData[i + 1];
394      imgdata.lens.makernotes.LensFStops = (float)imgdata.lens.nikon.NikonLensFStops /12.0f;
395 -    imgdata.lens.makernotes.MinFocal = 5.0f * powf64(2.0f, (float)LensData[i + 2] / 24.0f);
396 -    imgdata.lens.makernotes.MaxFocal = 5.0f * powf64(2.0f, (float)LensData[i + 3] / 24.0f);
397 -    imgdata.lens.makernotes.MaxAp4MinFocal = powf64(2.0f, (float)LensData[i + 4] / 24.0f);
398 -    imgdata.lens.makernotes.MaxAp4MaxFocal = powf64(2.0f, (float)LensData[i + 5] / 24.0f);
399 +    imgdata.lens.makernotes.MinFocal = 5.0f * powf_64(2.0f, (float)LensData[i + 2] / 24.0f);
400 +    imgdata.lens.makernotes.MaxFocal = 5.0f * powf_64(2.0f, (float)LensData[i + 3] / 24.0f);
401 +    imgdata.lens.makernotes.MaxAp4MinFocal = powf_64(2.0f, (float)LensData[i + 4] / 24.0f);
402 +    imgdata.lens.makernotes.MaxAp4MaxFocal = powf_64(2.0f, (float)LensData[i + 5] / 24.0f);
403      imgdata.lens.nikon.NikonMCUVersion = LensData[i + 6];
404      if (i != 2)
405        {
406 -        imgdata.lens.makernotes.CurFocal = 5.0f * powf64(2.0f, (float)LensData[i - 1] / 24.0f);
407 -        imgdata.lens.nikon.NikonEffectiveMaxAp = powf64(2.0f, (float)LensData[i + 7] / 24.0f);
408 +        imgdata.lens.makernotes.CurFocal = 5.0f * powf_64(2.0f, (float)LensData[i - 1] / 24.0f);
409 +        imgdata.lens.nikon.NikonEffectiveMaxAp = powf_64(2.0f, (float)LensData[i + 7] / 24.0f);
410        }
411      imgdata.lens.makernotes.LensID =
412        (unsigned long long) LensData[i] << 56 |
413 @@ -6379,11 +6379,11 @@ void CLASS process_Sony_0x9050 (uchar * buf, unsigned id)
414      {
415        if (buf[0])
416          imgdata.lens.makernotes.MaxAp =
417 -          my_roundf(powf64(2.0f, ((float)SonySubstitution[buf[0]] / 8.0 - 1.06f) / 2.0f)*10.0f) / 10.0f;
418 +          my_roundf(powf_64(2.0f, ((float)SonySubstitution[buf[0]] / 8.0 - 1.06f) / 2.0f)*10.0f) / 10.0f;
419  
420        if (buf[1])
421          imgdata.lens.makernotes.MinAp =
422 -          my_roundf(powf64(2.0f, ((float)SonySubstitution[buf[1]] / 8.0 - 1.06f) / 2.0f)*10.0f) / 10.0f;
423 +          my_roundf(powf_64(2.0f, ((float)SonySubstitution[buf[1]] / 8.0 - 1.06f) / 2.0f)*10.0f) / 10.0f;
424      }
425  
426    if (imgdata.lens.makernotes.CameraMount != LIBRAW_MOUNT_FixedLens)
427 @@ -6393,7 +6393,7 @@ void CLASS process_Sony_0x9050 (uchar * buf, unsigned id)
428            lid = SonySubstitution[buf[0x3d]] << 8 |
429              SonySubstitution[buf[0x3c]];
430            imgdata.lens.makernotes.CurAp =
431 -            powf64(2.0f, ((float)lid/256.0f - 16.0f) / 2.0f);
432 +            powf_64(2.0f, ((float)lid/256.0f - 16.0f) / 2.0f);
433          }
434        if (buf[0x105] && (imgdata.lens.makernotes.LensMount != LIBRAW_MOUNT_Canon_EF))
435          imgdata.lens.makernotes.LensMount =
436 @@ -6773,7 +6773,7 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer)
437            {
438              unsigned char cc;
439              fread(&cc, 1, 1, ifp);
440 -            iso_speed = (int)(100.0 * powf64(2.0, (double)(cc) / 12.0 - 5.0));
441 +            iso_speed = (int)(100.0 * powf_64(2.0, (double)(cc) / 12.0 - 5.0));
442              break;
443            }
444        }
445 @@ -6805,7 +6805,7 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer)
446            }
447            break;
448          case 0x1002:
449 -          imgdata.lens.makernotes.CurAp = powf64(2.0f, getreal(type)/2);
450 +          imgdata.lens.makernotes.CurAp = powf_64(2.0f, getreal(type)/2);
451            break;
452          case 0x20100201:
453            imgdata.lens.makernotes.LensID =
454 @@ -6825,10 +6825,10 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer)
455            fread(imgdata.lens.makernotes.Lens, len, 1, ifp);
456            break;
457          case 0x20100205:
458 -          imgdata.lens.makernotes.MaxAp4MinFocal = powf64(sqrt(2.0f), get2() / 256.0f);
459 +          imgdata.lens.makernotes.MaxAp4MinFocal = powf_64(sqrt(2.0f), get2() / 256.0f);
460            break;
461          case 0x20100206:
462 -          imgdata.lens.makernotes.MaxAp4MaxFocal = powf64(sqrt(2.0f), get2() / 256.0f);
463 +          imgdata.lens.makernotes.MaxAp4MaxFocal = powf_64(sqrt(2.0f), get2() / 256.0f);
464            break;
465          case 0x20100207:
466            imgdata.lens.makernotes.MinFocal = (float)get2();
467 @@ -6839,7 +6839,7 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer)
468              imgdata.lens.makernotes.MaxFocal = imgdata.lens.makernotes.MinFocal;
469            break;
470          case 0x2010020a:
471 -          imgdata.lens.makernotes.MaxAp4CurFocal = powf64(sqrt(2.0f), get2() / 256.0f);
472 +          imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(sqrt(2.0f), get2() / 256.0f);
473            break;
474          case 0x20100301:
475            imgdata.lens.makernotes.TeleconverterID = fgetc(ifp) << 8;
476 @@ -6937,13 +6937,13 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer)
477                  if (table_buf[iLensData+9] &&
478                      (fabs(imgdata.lens.makernotes.CurFocal) < 0.1f))
479                    imgdata.lens.makernotes.CurFocal =
480 -                    10*(table_buf[iLensData+9]>>2) * powf64(4, (table_buf[iLensData+9] & 0x03)-2);
481 +                    10*(table_buf[iLensData+9]>>2) * powf_64(4, (table_buf[iLensData+9] & 0x03)-2);
482                  if (table_buf[iLensData+10] & 0xf0)
483                    imgdata.lens.makernotes.MaxAp4CurFocal =
484 -                    powf64(2.0f, (float)((table_buf[iLensData+10] & 0xf0) >>4)/4.0f);
485 +                    powf_64(2.0f, (float)((table_buf[iLensData+10] & 0xf0) >>4)/4.0f);
486                  if (table_buf[iLensData+10] & 0x0f)
487                    imgdata.lens.makernotes.MinAp4CurFocal =
488 -                    powf64(2.0f, (float)((table_buf[iLensData+10] & 0x0f) + 10)/4.0f);
489 +                    powf_64(2.0f, (float)((table_buf[iLensData+10] & 0x0f) + 10)/4.0f);
490                  if (
491                      (imgdata.lens.makernotes.CamID != 0x12e6c) &&      // K-r
492                      (imgdata.lens.makernotes.CamID != 0x12e76) &&      // K-5
493 @@ -6964,14 +6964,14 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer)
494                      if ((table_buf[iLensData+14] > 1) &&
495                          (fabs(imgdata.lens.makernotes.MaxAp4CurFocal) < 0.7f))
496                        imgdata.lens.makernotes.MaxAp4CurFocal =
497 -                        powf64(2.0f, (float)((table_buf[iLensData+14] & 0x7f) -1)/32.0f);
498 +                        powf_64(2.0f, (float)((table_buf[iLensData+14] & 0x7f) -1)/32.0f);
499                    }
500                  else if ((imgdata.lens.makernotes.CamID != 0x12e76) && // K-5
501                           (table_buf[iLensData+15] > 1) &&
502                           (fabs(imgdata.lens.makernotes.MaxAp4CurFocal) < 0.7f))
503                    {
504                      imgdata.lens.makernotes.MaxAp4CurFocal =
505 -                      powf64(2.0f, (float)((table_buf[iLensData+15] & 0x7f) -1)/32.0f);
506 +                      powf_64(2.0f, (float)((table_buf[iLensData+15] & 0x7f) -1)/32.0f);
507                    }
508                }
509              free(table_buf);
510 @@ -7137,7 +7137,7 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer)
511                    lid = (((ushort)table_buf[2])<<8) |
512                      ((ushort)table_buf[3]);
513                    imgdata.lens.makernotes.CurAp =
514 -                    powf64(2.0f, ((float)lid/8.0f-1.0f)/2.0f);
515 +                    powf_64(2.0f, ((float)lid/8.0f-1.0f)/2.0f);
516                  }
517                break;
518              case 1536:
519 @@ -7617,7 +7617,7 @@ void CLASS parse_makernote (int base, int uptag)
520            }
521            break;
522          case 0x1002:
523 -          imgdata.lens.makernotes.CurAp = powf64(2.0f, getreal(type)/2);
524 +          imgdata.lens.makernotes.CurAp = powf_64(2.0f, getreal(type)/2);
525            break;
526          case 0x20100201:
527            imgdata.lens.makernotes.LensID =
528 @@ -7637,10 +7637,10 @@ void CLASS parse_makernote (int base, int uptag)
529            fread(imgdata.lens.makernotes.Lens, len, 1, ifp);
530            break;
531          case 0x20100205:
532 -          imgdata.lens.makernotes.MaxAp4MinFocal = powf64(sqrt(2.0f), get2() / 256.0f);
533 +          imgdata.lens.makernotes.MaxAp4MinFocal = powf_64(sqrt(2.0f), get2() / 256.0f);
534            break;
535          case 0x20100206:
536 -          imgdata.lens.makernotes.MaxAp4MaxFocal = powf64(sqrt(2.0f), get2() / 256.0f);
537 +          imgdata.lens.makernotes.MaxAp4MaxFocal = powf_64(sqrt(2.0f), get2() / 256.0f);
538            break;
539          case 0x20100207:
540            imgdata.lens.makernotes.MinFocal = (float)get2();
541 @@ -7651,7 +7651,7 @@ void CLASS parse_makernote (int base, int uptag)
542              imgdata.lens.makernotes.MaxFocal = imgdata.lens.makernotes.MinFocal;
543            break;
544          case 0x2010020a:
545 -          imgdata.lens.makernotes.MaxAp4CurFocal = powf64(sqrt(2.0f), get2() / 256.0f);
546 +          imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(sqrt(2.0f), get2() / 256.0f);
547            break;
548          case 0x20100301:
549            imgdata.lens.makernotes.TeleconverterID = fgetc(ifp) << 8;
550 @@ -7809,13 +7809,13 @@ void CLASS parse_makernote (int base, int uptag)
551                {
552                  if (table_buf[iLensData+9] && (fabs(imgdata.lens.makernotes.CurFocal) < 0.1f))
553                    imgdata.lens.makernotes.CurFocal =
554 -                    10*(table_buf[iLensData+9]>>2) * powf64(4, (table_buf[iLensData+9] & 0x03)-2);
555 +                    10*(table_buf[iLensData+9]>>2) * powf_64(4, (table_buf[iLensData+9] & 0x03)-2);
556                  if (table_buf[iLensData+10] & 0xf0)
557                    imgdata.lens.makernotes.MaxAp4CurFocal =
558 -                    powf64(2.0f, (float)((table_buf[iLensData+10] & 0xf0) >>4)/4.0f);
559 +                    powf_64(2.0f, (float)((table_buf[iLensData+10] & 0xf0) >>4)/4.0f);
560                  if (table_buf[iLensData+10] & 0x0f)
561                    imgdata.lens.makernotes.MinAp4CurFocal =
562 -                    powf64(2.0f, (float)((table_buf[iLensData+10] & 0x0f) + 10)/4.0f);
563 +                    powf_64(2.0f, (float)((table_buf[iLensData+10] & 0x0f) + 10)/4.0f);
564                  if (
565                      (imgdata.lens.makernotes.CamID != 0x12e6c) &&      // K-r
566                      (imgdata.lens.makernotes.CamID != 0x12e76) &&      // K-5
567 @@ -7836,14 +7836,14 @@ void CLASS parse_makernote (int base, int uptag)
568                      if ((table_buf[iLensData+14] > 1) &&
569                          (fabs(imgdata.lens.makernotes.MaxAp4CurFocal) < 0.7f))
570                        imgdata.lens.makernotes.MaxAp4CurFocal =
571 -                        powf64(2.0f, (float)((table_buf[iLensData+14] & 0x7f) -1)/32.0f);
572 +                        powf_64(2.0f, (float)((table_buf[iLensData+14] & 0x7f) -1)/32.0f);
573                    }
574                  else if ((imgdata.lens.makernotes.CamID != 0x12e76) && // K-5
575                           (table_buf[iLensData+15] > 1) &&
576                           (fabs(imgdata.lens.makernotes.MaxAp4CurFocal) < 0.7f))
577                    {
578                      imgdata.lens.makernotes.MaxAp4CurFocal =
579 -                      powf64(2.0f, (float)((table_buf[iLensData+15] & 0x7f) -1)/32.0f);
580 +                      powf_64(2.0f, (float)((table_buf[iLensData+15] & 0x7f) -1)/32.0f);
581                    }
582                }
583              free(table_buf);
584 @@ -8004,7 +8004,7 @@ void CLASS parse_makernote (int base, int uptag)
585                    lid = (((ushort)table_buf[2])<<8) |
586                      ((ushort)table_buf[3]);
587                    imgdata.lens.makernotes.CurAp =
588 -                    powf64(2.0f, ((float)lid/8.0f-1.0f)/2.0f);
589 +                    powf_64(2.0f, ((float)lid/8.0f-1.0f)/2.0f);
590                  }
591                break;
592              case 1536:
593 @@ -8089,15 +8089,15 @@ void CLASS parse_makernote (int base, int uptag)
594        {
595          unsigned char cc;
596          fread(&cc,1,1,ifp);
597 -        iso_speed = int(100.0 * powf64(2.0f,float(cc)/12.0-5.0));
598 +        iso_speed = int(100.0 * powf_64(2.0f,float(cc)/12.0-5.0));
599        }
600      if (tag == 4 && len > 26 && len < 35) {
601        if ((i=(get4(),get2())) != 0x7fff && (!iso_speed || iso_speed == 65535))
602 -       iso_speed = 50 * powf64(2.0, i/32.0 - 4);
603 +       iso_speed = 50 * powf_64(2.0, i/32.0 - 4);
604        if ((i=(get2(),get2())) != 0x7fff && !aperture)
605 -       aperture = powf64(2.0, i/64.0);
606 +       aperture = powf_64(2.0, i/64.0);
607        if ((i=get2()) != 0xffff && !shutter)
608 -       shutter = powf64(2.0, (short) i/-32.0);
609 +       shutter = powf_64(2.0, (short) i/-32.0);
610        wbi = (get2(),get2());
611        shot_order = (get2(),get2());
612      }
613 @@ -8548,7 +8548,7 @@ void CLASS parse_exif (int base)
614          imgdata.lens.Lens[0] = 0;
615        break;
616      case 0x9205:
617 -      imgdata.lens.EXIF_MaxAp = powf64(2.0f, (getreal(type) / 2.0f));
618 +      imgdata.lens.EXIF_MaxAp = powf_64(2.0f, (getreal(type) / 2.0f));
619        break;
620  #endif
621        case 33434:  shutter = getreal(type);            break;
622 @@ -8561,10 +8561,10 @@ void CLASS parse_exif (int base)
623        case 36867:
624        case 36868:  get_timestamp(0);                   break;
625        case 37377:  if ((expo = -getreal(type)) < 128 && shutter == 0.)
626 -          shutter = powf64(2.0, expo);         break;
627 +          shutter = powf_64(2.0, expo);                break;
628        case 37378:
629          if (fabs(ape = getreal(type))<256.0)
630 -          aperture = powf64(2.0, ape/2);
631 +          aperture = powf_64(2.0, ape/2);
632          break;
633        case 37385:  flash_used = getreal(type);          break;
634        case 37386:  focal_len = getreal(type);          break;
635 @@ -9171,7 +9171,7 @@ int CLASS parse_tiff_ifd (int base)
636          imgdata.lens.Lens[0] = 0;
637        break;
638      case 0x9205:
639 -                               imgdata.lens.EXIF_MaxAp = powf64(2.0f, (getreal(type) / 2.0f));
640 +                               imgdata.lens.EXIF_MaxAp = powf_64(2.0f, (getreal(type) / 2.0f));
641        break;
642  // IB end
643  #endif
644 @@ -9940,22 +9940,22 @@ void CLASS parse_ciff (int offset, int length, int depth)
645        thumb_length = len;
646      }
647      if (type == 0x1818) {
648 -      shutter = powf64(2.0f, -int_to_float((get4(),get4())));
649 -      aperture = powf64(2.0f, int_to_float(get4())/2);
650 +      shutter = powf_64(2.0f, -int_to_float((get4(),get4())));
651 +      aperture = powf_64(2.0f, int_to_float(get4())/2);
652  #ifdef LIBRAW_LIBRARY_BUILD
653                         imgdata.lens.makernotes.CurAp = aperture;
654  #endif
655      }
656      if (type == 0x102a) {
657                         //      iso_speed = pow (2.0, (get4(),get2())/32.0 - 4) * 50;
658 -      iso_speed = powf64(2.0f, ((get2(),get2()) + get2())/32.0f - 5.0f) * 100.0f;
659 +      iso_speed = powf_64(2.0f, ((get2(),get2()) + get2())/32.0f - 5.0f) * 100.0f;
660  #ifdef LIBRAW_LIBRARY_BUILD
661        aperture  = _CanonConvertAperture((get2(),get2()));
662        imgdata.lens.makernotes.CurAp = aperture;
663  #else
664 -      aperture  = powf64(2.0, (get2(),(short)get2())/64.0);
665 +      aperture  = powf_64(2.0, (get2(),(short)get2())/64.0);
666  #endif
667 -      shutter   = powf64(2.0,-((short)get2())/32.0);
668 +      shutter   = powf_64(2.0,-((short)get2())/32.0);
669        wbi = (get2(),get2());
670        if (wbi > 17) wbi = 0;
671        fseek (ifp, 32, SEEK_CUR);
672 @@ -10159,8 +10159,8 @@ void CLASS parse_phase_one (int base)
673        setPhaseOneFeatures(unique_id);
674        break;
675      case 0x0401:
676 -      if (type == 4) imgdata.lens.makernotes.CurAp =  powf64(2.0f, (int_to_float(data)/2.0f));
677 -      else imgdata.lens.makernotes.CurAp = powf64(2.0f, (getreal(type)/2.0f));
678 +      if (type == 4) imgdata.lens.makernotes.CurAp =  powf_64(2.0f, (int_to_float(data)/2.0f));
679 +      else imgdata.lens.makernotes.CurAp = powf_64(2.0f, (getreal(type)/2.0f));
680        break;
681      case 0x0403:
682        if (type == 4) imgdata.lens.makernotes.CurFocal =  int_to_float(data);
683 @@ -10174,16 +10174,16 @@ void CLASS parse_phase_one (int base)
684        break;
685      case 0x0414:
686        if (type == 4) {
687 -       imgdata.lens.makernotes.MaxAp4CurFocal = powf64(2.0f, (int_to_float(data)/2.0f));
688 +       imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(2.0f, (int_to_float(data)/2.0f));
689        } else {
690 -        imgdata.lens.makernotes.MaxAp4CurFocal = powf64(2.0f, (getreal(type) / 2.0f));
691 +        imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(2.0f, (getreal(type) / 2.0f));
692        }
693        break;
694      case 0x0415:
695        if (type == 4) {
696 -       imgdata.lens.makernotes.MinAp4CurFocal = powf64(2.0f, (int_to_float(data)/2.0f));
697 +       imgdata.lens.makernotes.MinAp4CurFocal = powf_64(2.0f, (int_to_float(data)/2.0f));
698        } else {
699 -        imgdata.lens.makernotes.MinAp4CurFocal = powf64(2.0f, (getreal(type) / 2.0f));
700 +        imgdata.lens.makernotes.MinAp4CurFocal = powf_64(2.0f, (getreal(type) / 2.0f));
701        }
702        break;
703      case 0x0416:
704 @@ -11996,15 +11996,15 @@ void CLASS identify()
705        case 18: iso_speed = 320; break;
706        case 19: iso_speed = 400; break;
707      }
708 -    shutter = powf64(2.0f, (((float)get4())/8.0f)) / 16000.0f;
709 +    shutter = powf_64(2.0f, (((float)get4())/8.0f)) / 16000.0f;
710      FORC4 cam_mul[c ^ (c >> 1)] = get4();
711      fseek (ifp, 88, SEEK_SET);
712 -    aperture = powf64(2.0f, ((float)get4())/16.0f);
713 +    aperture = powf_64(2.0f, ((float)get4())/16.0f);
714      fseek (ifp, 112, SEEK_SET);
715      focal_len = get4();
716  #ifdef LIBRAW_LIBRARY_BUILD
717      fseek (ifp, 104, SEEK_SET);
718 -    imgdata.lens.makernotes.MaxAp4CurFocal = powf64(2.0f, ((float)get4())/16.0f);
719 +    imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(2.0f, ((float)get4())/16.0f);
720      fseek (ifp, 124, SEEK_SET);
721      fread(imgdata.lens.makernotes.Lens, 32, 1, ifp);
722      imgdata.lens.makernotes.CameraMount = LIBRAW_MOUNT_Contax_N;
723 -- 
724 2.14.1
725