The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=11780 
====================================================================== 
Reported By:                Dongsheng Song
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   11780
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2011-02-01 03:07 EST
Last Modified:              2011-02-01 03:07 EST
====================================================================== 
Summary:                    CMake cannot building by VC6 with PSDK
Description: 
Tested with PSDK February 2003 edition.

C:\>set inc
INCLUDE=C:\Program Files\Microsoft SDK\include;C:\opt\vs1998\vc98\include

C:\>set lib
LIB=C:\Program Files\Microsoft SDK\lib;C:\opt\vs1998\vc98\lib

In Utilities\cmlibarchive\libarchive\archive_windows.c, the following code is
not correct:

#if defined(_MSC_VER) && _MSC_VER < 1300
/* VS 6 does not provide SetFilePointerEx, so define it here.  */
static BOOL SetFilePointerEx(HANDLE hFile,
                             LARGE_INTEGER liDistanceToMove,
                             PLARGE_INTEGER lpNewFilePointer,
                             DWORD dwMoveMethod)
{
  LARGE_INTEGER li;
  li.QuadPart = liDistanceToMove.QuadPart;
  li.LowPart = SetFilePointer(hFile, li.LowPart, &li.HighPart, dwMoveMethod);
  if(lpNewFilePointer) { lpNewFilePointer->QuadPart = li.QuadPart; }
  return li.LowPart != -1 || GetLastError() == NO_ERROR;
}
#endif

Because VC6 with PSDK have SetFilePointerEx, we should use VER_PRODUCTBUILD
which defined in <ntverp.h>:

#include <ntverp.h>

/* Windows 2000/XP or later have SetFilePointerEx defined */
#if (_MSC_VER < 1300) && (VER_PRODUCTBUILD < 2600)
static BOOL SetFilePointerEx(HANDLE hFile,
                             LARGE_INTEGER liDistanceToMove,
                             PLARGE_INTEGER lpNewFilePointer,
                             DWORD dwMoveMethod)
{
  LARGE_INTEGER li;
  li.QuadPart = liDistanceToMove.QuadPart;
  li.LowPart = SetFilePointer(hFile, li.LowPart, &li.HighPart, dwMoveMethod);
  if(lpNewFilePointer) { lpNewFilePointer->QuadPart = li.QuadPart; }
  return li.LowPart != -1 || GetLastError() == NO_ERROR;
}
#endif


Steps to Reproduce: 
O:\vcs\git\cmake\Utilities\cmlibarchive\libarchive\archive_windows.c(74) : error
C2373: 'SetFilePointerEx' : redefinition; different type modifiers
        C:\Program Files\Microsoft SDK\include\winbase.h(3393) : see declaration
of 'SetFilePointerEx'
NMAKE : fatal error U1077: 'C:\opt\vs1998\VC98\Bin\CL.EXE' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'C:\opt\vs1998\vc98\bin\NMAKE.EXE' : return code
'0x2'
Stop.
NMAKE : fatal error U1077: 'C:\opt\vs1998\vc98\bin\NMAKE.EXE' : return code
'0x2'
Stop.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-02-01 03:07 Dongsheng Song New Issue                                    
======================================================================

_______________________________________________
cmake-developers mailing list
cmake-developers@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to