Explorar el Código

Merged revisions 10233 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk

........
r10233 | Almindor | 2008-02-05 19:15:21 +0100 (Ut, 05 feb 2008) | 2 lines

* hack around the fpc cdecl/stack bug in 64bit linux by using qword-wrapper

........

git-svn-id: branches/fixes_2_2@10234 -

Almindor hace 17 años
padre
commit
f07c3944dd
Se han modificado 1 ficheros con 22 adiciones y 5 borrados
  1. 22 5
      packages/aspell/src/aspell.pp

+ 22 - 5
packages/aspell/src/aspell.pp

@@ -417,7 +417,8 @@ uses
      * misspelled words, then token.word will be
      * NULL and token.size will be 0  }
 
-    function aspell_document_checker_next_misspelling(ths:PAspellDocumentChecker):AspellToken;cdecl;external libaspell name 'aspell_document_checker_next_misspelling';
+    // internal hacky version to go around a bug regarding struct results/cdecl
+    function __aspell_document_checker_next_misspelling(ths:PAspellDocumentChecker):QWord;cdecl;external libaspell name 'aspell_document_checker_next_misspelling';
 
     { Returns the underlying filter class.  }
 
@@ -822,7 +823,8 @@ var
        * misspelled words, then token.word will be
        * NULL and token.size will be 0  }
 
-  aspell_document_checker_next_misspelling: function(ths:PAspellDocumentChecker):AspellToken;cdecl;
+  // hack around struct/cdecl problem
+  __aspell_document_checker_next_misspelling: function(ths:PAspellDocumentChecker):QWord;cdecl;
 
       { Returns the underlying filter class.  }
 
@@ -978,6 +980,7 @@ var
 
   function aspell_init(const libn: ansistring): Boolean;
   function aspell_loaded: Boolean;
+  function aspell_document_checker_next_misspelling(ths:PAspellDocumentChecker):AspellToken;
 
 implementation
 
@@ -993,6 +996,13 @@ begin
   aspell_loaded := True;
 end;
 
+function aspell_document_checker_next_misspelling(ths: PAspellDocumentChecker
+  ): AspellToken;
+begin
+  // yup...
+  aspell_document_checker_next_misspelling := AspellToken(__aspell_document_checker_next_misspelling(ths));
+end;
+
 {$ELSE} // dynamic
 
 uses
@@ -1316,9 +1326,9 @@ begin
   Pointer(aspell_document_checker_process) := GetProcedureAddress(LibHandle, 'aspell_document_checker_process');
   if not Assigned(aspell_document_checker_process) then Exit(False);
 
-  aspell_document_checker_next_misspelling := nil;
-  Pointer(aspell_document_checker_next_misspelling) := GetProcedureAddress(LibHandle, 'aspell_document_checker_next_misspelling');
-  if not Assigned(aspell_document_checker_next_misspelling) then Exit(False);
+  __aspell_document_checker_next_misspelling := nil;
+  Pointer(__aspell_document_checker_next_misspelling) := GetProcedureAddress(LibHandle, 'aspell_document_checker_next_misspelling');
+  if not Assigned(__aspell_document_checker_next_misspelling) then Exit(False);
 
   aspell_document_checker_filter := nil;
   Pointer(aspell_document_checker_filter) := GetProcedureAddress(LibHandle, 'aspell_document_checker_filter');
@@ -1558,6 +1568,13 @@ begin
   aspell_loaded := LibHandle <> 0;
 end;
 
+function aspell_document_checker_next_misspelling(ths: PAspellDocumentChecker
+  ): AspellToken;
+begin
+  // yup...
+  aspell_document_checker_next_misspelling := AspellToken(__aspell_document_checker_next_misspelling(ths));
+end;
+
 initialization
   aspell_init(libaspell);