Browse Source

* Define CExtended and clongdouble as double for Android.

git-svn-id: branches/targetandroid@23487 -
yury 12 years ago
parent
commit
e82983e577
2 changed files with 8 additions and 4 deletions
  1. 7 3
      compiler/psystem.pas
  2. 1 1
      rtl/inc/ctypes.pp

+ 7 - 3
compiler/psystem.pas

@@ -300,10 +300,14 @@ implementation
             addtype('Extended',pbestrealtype^);
             addtype('Extended',pbestrealtype^);
             { CExtended corresponds to the C version of the Extended type
             { CExtended corresponds to the C version of the Extended type
               (either "long double" or "double") }
               (either "long double" or "double") }
-            if tfloatdef(pbestrealtype^).floattype=s80real then
-              addtype('CExtended',sc80floattype)
+            if target_info.system in systems_android then
+              { Android has "long double"="double" even for x86 }
+              addtype('CExtended',s64floattype)
             else
             else
-              addtype('CExtended',pbestrealtype^);
+              if tfloatdef(pbestrealtype^).floattype=s80real then
+                addtype('CExtended',sc80floattype)
+              else
+                addtype('CExtended',pbestrealtype^);
           end;
           end;
 {$ifdef x86}
 {$ifdef x86}
 {$ifndef FPC_SUPPORT_X87_TYPES_ON_WIN64}
 {$ifndef FPC_SUPPORT_X87_TYPES_ON_WIN64}

+ 1 - 1
rtl/inc/ctypes.pp

@@ -90,7 +90,7 @@ type
 {$endif}
 {$endif}
 {$endif}
 {$endif}
 
 
-{$ifdef defined(win64) or defined(wince)}
+{$if defined(win64) or defined(wince) or defined(android)}
   {$define longdouble_is_double}
   {$define longdouble_is_double}
 {$endif}
 {$endif}