FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

WindowsAPI: const pointer types for D2

 
Post new topic   Reply to topic     Forum Index -> Bindings
View previous topic :: View next topic  
Author Message
smjg



Joined: 29 Sep 2004
Posts: 41

PostPosted: Thu Nov 06, 2008 9:33 am    Post subject: WindowsAPI: const pointer types for D2 Reply with quote

I've figured that it's time to start adapting the WindowsAPI project to support D2.

This means, at the least, declaring pointer types as const where appropriate. Of course, this needs to be done without breaking D1 compatibility.

Fortunately, I've found a way of doing it. The CPtr template is now defined in basetsd.d. I don't know if there's a better place where it could be put. Maybe if we find ourselves with more to do towards full D2 compatibility, we could start a separate module to keep the support code in one place.

Please use this template to translate any const pointer types declared in MinGW. It will be necessary both to do this when adding stuff to our translation and to update what's already done to this. I will update the wiki pages in due course.
Back to top
View user's profile Send private message
leo



Joined: 28 Feb 2008
Posts: 4

PostPosted: Wed Feb 04, 2009 11:05 am    Post subject: Reply with quote

If I import win32.windows on dmd 1.039 I receive three "template instance forward reference" errors in winnt.d line 48.
This error is probably caused by the circular dependencies between basetsd.d and winnt.d. So I think it would be better to put the declaration in some other file, basetyps.d didn't seem suitable to me as well, because it imports windef and thus also winnt. So far I couldn't find any other solution than putting CPtr into a new file.

Or did I do anything wrong?
Back to top
View user's profile Send private message
smjg



Joined: 29 Sep 2004
Posts: 41

PostPosted: Wed Feb 04, 2009 8:14 pm    Post subject: Reply with quote

leo wrote:
If I import win32.windows on dmd 1.039 I receive three "template instance forward reference" errors in winnt.d line 48.
This error is probably caused by the circular dependencies between basetsd.d and winnt.d. So I think it would be better to put the declaration in some other file, basetyps.d didn't seem suitable to me as well, because it imports windef and thus also winnt. So far I couldn't find any other solution than putting CPtr into a new file.

The current version works for me.
leo wrote:
Or did I do anything wrong?

Like forgetting to update your working copy of the bindings? If not, maybe if you can provide a minimal code example that shows the problem then it would help.
Back to top
View user's profile Send private message
leo



Joined: 28 Feb 2008
Posts: 4

PostPosted: Thu Feb 05, 2009 8:06 am    Post subject: Reply with quote

rev 315 was the last working version, I'm using rev 324 now.
The minimal test case ^^ :
Code:
// test.d
import win32.windows;

I forgot to mention that I'm using dsss, trying dmd it works okay though, so actually it's rather a rebuild bug
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Bindings All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group