Re: [fpc-devel] Apache header translation Patch

2007-11-12 Thread Inoussa OUEDRAOGO
 You can't get rid of that warning, and it should actually even be
 worded more strongly. It is simply not possible to access C-style
 varargs parameters at the callee side in FPC (you may be able to hak
 using pointers which will work on some platforms, but it will crash
 and burn in most cases).

This is the c prototype ( type ) translated, actualy it is a array of PCHAR.

code taken from apache source
const char *(*take_argv) (cmd_parms *parms, void *mconfig,
 int argc, char *const argv[]);
/code

Is the following translation valid ?

take_argv_t = function (parms: Pcmd_parms; mconfig: Pointer; argc:
cint; argv: array of PChar): PChar; cdecl;

-- 
Inoussa O.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Apache header translation Patch

2007-11-12 Thread Jonas Maebe


On 12 Nov 2007, at 10:32, Inoussa OUEDRAOGO wrote:

This is the c prototype ( type ) translated, actualy it is a array  
of PCHAR.


code taken from apache source
const char *(*take_argv) (cmd_parms *parms, void *mconfig,
 int argc, char *const argv[]);
/code

Is the following translation valid ?

take_argv_t = function (parms: Pcmd_parms; mconfig: Pointer; argc:
cint; argv: array of PChar): PChar; cdecl;


I think it's better to do this:

take_argv_t = function (parms: Pcmd_parms; mconfig: Pointer;  
argc:cint; argv: PPChar): PChar; cdecl;


You can still index it as an array in FPC, but it's clearer what the  
actual type is that gets passed (an array of pchar is the same as a  
double pointer to char in C). I was indeed wrong about the varargs  
stuff I said earlier, for some reason I had read array of pchar as  
array of const.



Jonas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Apache header translation Patch

2007-11-12 Thread Inoussa OUEDRAOGO
 More importantly then supressing it, which I consider something
 unimportant, would be knowing what it means, and if there is some kind
 of potential problem it indicates that we are overlooking.
Agree, clarified by Jonas's response .

By the way, have you been able to make a module on ( Linux + Apache 2.2.x ) ?
I tried on
 - Ubuntu + Apache 2.2.3/2.2.4
 - Fedora + Apache 2.2.4
without succes. Even worse, in the handler proc, r^.handler ( used to
test if this request
should be handled by the current module ) always holds some weird
string,for a very basic
module. On windows it does work.


-- 
Inoussa O.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Apache header translation Patch

2007-11-12 Thread Marco van de Voort
  double pointer to char in C). I was indeed wrong about the varargs
  stuff I said earlier, for some reason I had read array of pchar as
  array of const.
 Ok, Thanks.
 
 By the way, h2pas should also be corrected, because it translates
   code langage=c
 void f(int a, char* p[]);
   /code
 
 to
   code langage=pascal
 procedure f(a:longint; p:array of pchar);cdecl;external;
   /code

Please file a bug report with examples, so that it doesn't get forgotten.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Apache header translation Patch

2007-11-12 Thread Inoussa OUEDRAOGO
done : http://www.freepascal.org/mantis/view.php?id=10156

2007/11/12, Marco van de Voort [EMAIL PROTECTED]:
   double pointer to char in C). I was indeed wrong about the varargs
   stuff I said earlier, for some reason I had read array of pchar as
   array of const.
  Ok, Thanks.
 
  By the way, h2pas should also be corrected, because it translates
code langage=c
  void f(int a, char* p[]);
/code
 
  to
code langage=pascal
  procedure f(a:longint; p:array of pchar);cdecl;external;
/code

 Please file a bug report with examples, so that it doesn't get forgotten.
 ___
 fpc-devel maillist  -  fpc-devel@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-devel



-- 
Inoussa O.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] fpmkunit

2007-11-12 Thread Darius Blaszijk
After reconsidering the -n option. It should depend on the -f / 
--config= option.


Darius

Darius Blaszijk wrote:
I've been playing around with fpmake again and came to the conclusion 
that it exhibits some strange behavior (at least I think so)


The -v option gave me the following fFCl command that was executed;

fpc -n -FUunits\i386-win32\ -Fu..\..\src\ -Fuunits\i386-win32\* 
myexample.pp


1. What strikes me is that the command line has the option -n in it. 
It appears that this command line option is hard coded in 
TBuildEngine.GetCompilerCommand. I strongly believe it should become a 
property named DefaultConfigFile which is by default set to True ie no 
'-n'.


2. -Fuunits\i386-win32\* I did not explicitly added this path. fpmake 
just takes this path by default. Is this desired behavior? I tend to 
believe not.


If agreed upon, I will prepare a patch.

Darius



___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel



___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] fpmkunit patch

2007-11-12 Thread Darius Blaszijk

The following patch fixes a broken TTarget.Mode.

Darius
Index: src/fpmkunit.pp
===
--- src/fpmkunit.pp	(revision 9207)
+++ src/fpmkunit.pp	(working copy)
@@ -1206,6 +1208,7 @@
 
 begin
   Result:=LowerCase(GetenumName(TypeInfo(TCompilerMode),Ord(Mode)));
+  Result := Copy(Result, 3, Length(Result) - 2);
 end;
 
 Function StringToMode(const S : String) : TCompilerMode;___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel