Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1249 (closed defect: fixed)

Opened 16 years ago

Last modified 16 years ago

Type conflict between "tango.sys.SharedLib.BOOL" and "tango.sys.win32.Types.BOOL"

Reported by: BenjiSmith Assigned to: h3r3tic
Priority: major Milestone: 0.99.8
Component: Core Functionality Version: trunk
Keywords: Cc:

Description

I have a simple test case where I'm trying to load a DLL using the SharedLib? library, while using type aliases defined in the win32 Types module, and the compiler reports an ambiguity between "tango.sys.SharedLib?.BOOL" and "tango.sys.win32.Types.BOOL".

The simple test case is:

import tango.sys.SharedLib;
import tango.sys.win32.Types;

struct MEMORYSTATUSEX
{
   DWORD dwLength;
   DWORD dwMemoryLoad;
   DWORDLONG ullTotalPhys;
   DWORDLONG ullAvailPhys;
   DWORDLONG ullTotalPageFile;
   DWORDLONG ullAvailPageFile;
   DWORDLONG ullTotalVirtual;
   DWORDLONG ullAvailVirtual;
   DWORDLONG ullAvailExtendedVirtual;
}

void main() {
  auto lib = SharedLib.load(`c:\windows\system32\kernel32.dll`);
  void* exFunctionPtr = lib.getSymbol("GlobalMemoryStatusEx");
  if (exFunctionPtr) {
    auto fnptr = cast(BOOL function(MEMORYSTATUSEX)) exFunctionPtr;
  }
}

Compiling with "dsss build", I get the following message:

typetest.d => typetest
+ D:\Development\d\libs\dsss\bin\rebuild.exe -Idsss_imports\ -I. -S.\ -ID:\Development\d\libs\dsss\include\d -SD:\Development\d\libs\dsss\lib\  -ID:\Development\d\libs\dsss\include\d -SD:\Development\d\libs\dsss\lib  -oqdsss_objs\D  typetest.d -oftypetest
typetest.d(23): Error: tango.sys.SharedLib.BOOL at D:/Development/d/libs/dsss/bin\..\include\d\tango\sys\SharedLib.di(20) conflicts with tango.sys.win32.Types.BOOL at D:/Development/d/libs/dsss/bin\..\include\d\tango\sys\win32\Types.di(15)
Command D:\Development\d\libs\dsss\bin\rebuild.exe returned with code 1, aborting.
Error: Command failed, aborting.

Change History

08/16/08 16:20:09 changed by larsivi

  • owner changed from sean to h3r3tic.

08/16/08 16:24:20 changed by kris

yeah, SharedLib? shouldn't have its own version of BOOL

08/16/08 17:53:01 changed by h3r3tic

  • status changed from new to closed.
  • resolution set to fixed.

Thanks for reporting, done!

08/16/08 22:19:02 changed by BenjiSmith

Wow. That was fast! Thanks!