Ah, I see, that makes sense. And it now compiles correctly, thanks.
On 2011-11-29 12:53, Dainius (GreatEmerald) wrote:
I seem to have another problem with the function pointer approach. I
am trying to set up a function that would pass the function pointers
from C to D, and DMD refuses to compile it:
If I have the function pointer struct with D calling convention
I seem to have another problem with the function pointer approach. I
am trying to set up a function that would pass the function pointers
from C to D, and DMD refuses to compile it:
If I have the function pointer struct with D calling convention
pointers, like this:
struct S_FrontendFunctions
I'm trying to implement the function pointer system right now, and it
seems to work on the C side, but not D. I assume I'm missing some kind
of syntax here. I have these global variables:
struct S_FrontendFunctions {
void function() RedrawScreen;
void function(const
Oh, so structs themselves are only definitions and not global
variables, I see. Thanks.
On Wed, 10 Aug 2011 10:35:46 +0200, Dainius (GreatEmerald)
wrote:
I seem to have run into a problem with the function pointer method
here. I have this code:
arco.d:
struct FrontendFunctions {
void function(SoundTypes) Sound_Play;
void function() RedrawScreenFull;
I seem to have run into a problem with the function pointer method
here. I have this code:
arco.d:
struct FrontendFunctions {
void function(SoundTypes) Sound_Play;
void function() RedrawScreenFull;
void function(const char*, int) PrecacheCard;
void function(Car
Yes, this is a library, so a main() there would be rather pointless.
However, it seems that on many occasions compilers will simply not
acknowledge anything without one, so I guess at least a declaration is
in order... I'll have to try that out once I get back on Windows.
Meanwhile, on Linux, I am
Dainius (GreatEmerald) Wrote:
> So, now my (static) library nearly links in Win32. There is only one
> link error, and apparently it's generated by phobos:
>
> ..\lib\phobos.lib(dmain2)
> Error 42: Symbol Undefined __end
>
> Any clues about what is happening? Admittedly, that phobos.lib
So, now my (static) library nearly links in Win32. There is only one
link error, and apparently it's generated by phobos:
..\lib\phobos.lib(dmain2)
Error 42: Symbol Undefined __end
Any clues about what is happening? Admittedly, that phobos.lib is from
March 20, 2011, so it's rather old b
I see. Well, I guess I'll have to stick to static ones until this gets
sorted out.
On 2011-07-28 21:55, Dainius (GreatEmerald) wrote:
On Thu, Jul 28, 2011 at 10:37 PM, Kai Meyer wrote:
On 07/27/2011 04:40 PM, Dainius (GreatEmerald) wrote:
One reason for the confusing responses is that in your original post you
said:
"a frontend (a library)", "a backend (an
executable)", "Shu
On Thu, Jul 28, 2011 at 10:37 PM, Kai Meyer wrote:
> On 07/27/2011 04:40 PM, Dainius (GreatEmerald) wrote:
>
> One reason for the confusing responses is that in your original post you
> said:
> "a frontend (a library)", "a backend (an
> executable)", "Shuffle() is a backend function", and "PlaySou
On 07/28/2011 01:18 AM, Dainius (GreatEmerald) wrote:
Hmm, there are still a whole lot of functions that call Shuffle(), so
it might not be ideal. However, this gives me an idea - if a pointer
to a function can be a parameter, can it be a global variable? In that
case, the frontend would indeed b
On 07/27/2011 04:40 PM, Dainius (GreatEmerald) wrote:
No no. It's the other way round. Shuffle() is in the library
(backend). PlaySound() is in the executable (frontend). Since I don't
want the library to be dependent on any sound libraries, I can't have
PlaySound() in it. And there is no other w
On Wed, 27 Jul 2011 13:41:37 -0400, Dainius (GreatEmerald)
wrote:
I have one program design problem and I wonder if anyone here could
give any suggestions about it. The situation is like this: I am
splitting a game into a frontend (a library) and a backend (an
executable). The backend is goin
Pelle Wrote:
> On Wed, 27 Jul 2011 19:41:37 +0200, Dainius (GreatEmerald)
> You could use a struct of function pointers to define the interface, if
This is known approach in app, using plugin. For example, then open source FAR
(File Archive Manager) exe load pluging dll, it fill strcuct with e
On Wed, 27 Jul 2011 19:41:37 +0200, Dainius (GreatEmerald)
wrote:
I have one program design problem and I wonder if anyone here could
give any suggestions about it. The situation is like this: I am
splitting a game into a frontend (a library) and a backend (an
executable). The backend is goin
Hmm, there are still a whole lot of functions that call Shuffle(), so
it might not be ideal. However, this gives me an idea - if a pointer
to a function can be a parameter, can it be a global variable? In that
case, the frontend would indeed be able to overwrite the function that
the backend calls
Dainius (GreatEmerald) Wrote:
> No no. It's the other way round. Shuffle() is in the library
> (backend). PlaySound() is in the executable (frontend). Since I don't
> want the library to be dependent on any sound libraries, I can't have
would you pass playSound() as parameter (callback) to shuffl
No no. It's the other way round. Shuffle() is in the library
(backend). PlaySound() is in the executable (frontend). Since I don't
want the library to be dependent on any sound libraries, I can't have
PlaySound() in it. And there is no other way that I can think of to
execute PlaySound() just at th
"Dainius (GreatEmerald)" wrote in message
news:mailman.1933.1311797423.14074.digitalmars-d-le...@puremagic.com...
> Hm, well, at least I don't know how it's possible for a binary to
> overwrite/capture a library's function. Would you care to give an
> example?
I'm not sure what you mean "overwri
Hm, well, at least I don't know how it's possible for a binary to
overwrite/capture a library's function. Would you care to give an
example?
"Dainius (GreatEmerald)" wrote in message
news:mailman.1931.1311788506.14074.digitalmars-d-le...@puremagic.com...
> For example, now I have a function Shuffle() that calls
> PlaySound(SHUFFLE). Shuffle() is a backend function, while PlaySound()
> is a frontend one, so obviously it won't work that
I have one program design problem and I wonder if anyone here could
give any suggestions about it. The situation is like this: I am
splitting a game into a frontend (a library) and a backend (an
executable). The backend is going to handle all the game mechanics,
while the frontend is going to handl
25 matches
Mail list logo