View previous topic :: View next topic |
Author |
Message |
smjg
Joined: 29 Sep 2004 Posts: 41
|
Posted: Thu Nov 06, 2008 9:33 am Post subject: WindowsAPI: const pointer types for D2 |
|
|
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 |
|
|
leo
Joined: 28 Feb 2008 Posts: 4
|
Posted: Wed Feb 04, 2009 11:05 am Post subject: |
|
|
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 |
|
|
smjg
Joined: 29 Sep 2004 Posts: 41
|
Posted: Wed Feb 04, 2009 8:14 pm Post subject: |
|
|
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 |
|
|
leo
Joined: 28 Feb 2008 Posts: 4
|
Posted: Thu Feb 05, 2009 8:06 am Post subject: |
|
|
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 |
|
|
|