Compatibility with Universal Headers 3.3 or later. a=leaf

This commit is contained in:
beard%netscape.com 2000-04-19 22:13:51 +00:00
Родитель c34d153a42
Коммит 3f1ed5ff9c
17 изменённых файлов: 98 добавлений и 15 удалений

Просмотреть файл

@ -156,6 +156,8 @@ else
Moz::StopForErrors();
#Moz::DontStopForErrors();
ConfigureBuildSystem();
Checkout();
SetBuildNumber();

Просмотреть файл

@ -189,6 +189,8 @@ else
Moz::StopForErrors();
#Moz::DontStopForErrors();
ConfigureBuildSystem();
Checkout();
chdir($MOZ_SRC);

Просмотреть файл

@ -22,7 +22,7 @@ use MacCVS;
use MANIFESTO;
@ISA = qw(Exporter);
@EXPORT = qw(Checkout BuildDist BuildProjects BuildCommonProjects BuildLayoutProjects BuildOneProject);
@EXPORT = qw(ConfigureBuildSystem Checkout BuildDist BuildProjects BuildCommonProjects BuildLayoutProjects BuildOneProject);
# NGLayoutBuildList builds the nglayout project
# it is configured by setting the following variables in the caller:
@ -176,6 +176,60 @@ sub _copy($$)
}
}
#//--------------------------------------------------------------------------------------------------
#// Configure Build System
#//--------------------------------------------------------------------------------------------------
my($UNIVERSAL_INTERFACES_VERSION) = 0x0320;
sub _processRunning($)
{
my($processName, $psn, $psi) = @_;
while ( ($psn, $psi) = each(%Process) ) {
if ($psi->processName eq $processName) { return 1; }
}
return 0;
}
sub _genBuildSystemInfo()
{
# always rebuild the configuration program.
BuildProjectClean(":mozilla:build:mac:tools:BuildSystemInfo:BuildSystemInfo.mcp", "BuildSystemInfo");
# delete the configuration file.
unlink(":mozilla:build:mac:BuildSystemInfo.pm");
# run the program.
system(":mozilla:build:mac:BuildSystemInfo");
# wait for the file to be created.
while (!(-e ":mozilla:build:mac:BuildSystemInfo.pm")) { WaitNextEvent(); }
# wait for BuildSystemInfo to finish, so that we see correct results.
while (_processRunning("BuildSystemInfo")) { WaitNextEvent(); }
# now, evaluate the contents of the file.
open(F, ":mozilla:build:mac:BuildSystemInfo.pm");
while (<F>) { eval; }
close(F);
}
# defines some build-system configuration variables.
sub ConfigureBuildSystem()
{
#// In the future, we may want to do configurations based on the actual build system itself.
#// _genBuildSystemInfo();
#// For now, if we discover a newer header file than existed in Universal Interfaces 3.2,
#// we'll assume that 3.3 or later is in use.
my($universal_interfaces) = getCodeWarriorPath("MacOS Support:Universal:Interfaces:CIncludes:");
if (-e ($universal_interfaces . "ControlDefinitions.h")) {
$UNIVERSAL_INTERFACES_VERSION = 0x0330;
}
printf("UNIVERSAL_INTERFACES_VERSION = 0x%04X\n", $UNIVERSAL_INTERFACES_VERSION);
}
#//--------------------------------------------------------------------------------------------------
#// Check out everything
#//--------------------------------------------------------------------------------------------------
@ -1350,8 +1404,7 @@ sub BuildRuntimeProjects()
}
else
{
#//if (0 /* $main::UNIVERSAL_HEADERS_VERSION >= 0x0330 */) {
if (0) {
if ($UNIVERSAL_INTERFACES_VERSION >= 0x0330) {
_BuildProject(":mozilla:lib:mac:InterfaceLib:Interface.mcp", "MacOS Interfaces (3.3)");
} else {
_BuildProject(":mozilla:lib:mac:InterfaceLib:Interface.mcp", "MacOS Interfaces");

Просмотреть файл

@ -24,7 +24,11 @@
#ifndef CarbonHelpers_h__
#define CarbonHelpers_h__
#if (UNIVERSAL_INTERFACES_VERSION >= 0x0330)
#include <ControlDefinitions.h>
#else
#include <Controls.h>
#endif
#include <Menus.h>
#include <Windows.h>
@ -73,11 +77,15 @@ inline void GetPortHiliteColor ( GrafPtr port, RGBColor* color )
}
}
#undef DisposeAEEventHandlerUPP
inline void DisposeAEEventHandlerUPP ( RoutineDescriptor* proc )
{
::DisposeRoutineDescriptor(proc);
}
#undef DisposeNavEventUPP
inline void DisposeNavEventUPP ( RoutineDescriptor* proc )
{
::DisposeRoutineDescriptor(proc);

Просмотреть файл

@ -213,7 +213,11 @@ static OSErr PreflightDirectoryCopySpace(short srcVRefNum,
if ( error == noErr )
{
/* Convert freeBytes to free disk blocks (512-byte blocks) */
#if (UNIVERSAL_INTERFACES_VERSION >= 0x0330)
dstFreeBlocks = (pb.ioVFreeBytes >> 9);
#else
dstFreeBlocks = (pb.ioVFreeBytes.hi << 23) + (pb.ioVFreeBytes.lo >> 9);
#endif
/* get allocation block size (always multiple of 512) and divide by 512
to get number of 512-byte blocks per allocation block */

Просмотреть файл

@ -182,7 +182,11 @@ static OSErr PreflightFileCopySpace(short srcVRefNum,
dstBlksPerAllocBlk = ((unsigned long)pb.xPB.ioVAlBlkSiz >> 9);
/* Convert freeBytes to free disk blocks (512-byte blocks) */
#if (UNIVERSAL_INTERFACES_VERSION >= 0x0330)
dstFreeBlocks = (pb.xPB.ioVFreeBytes >> 9);
#else
dstFreeBlocks = (pb.xPB.ioVFreeBytes.hi << 23) + (pb.xPB.ioVFreeBytes.lo >> 9);
#endif
/* Now, get the size of the file's data resource forks */
pb.hPB.fileParam.ioNamePtr = (StringPtr)srcName;

Просмотреть файл

@ -493,7 +493,7 @@ pascal OSErr XGetVInfo(short volReference,
*vRefNum = pb.ioVRefNum;
/* return the freeBytes and totalBytes */
#if TARGET_CARBON
#if TARGET_CARBON || (UNIVERSAL_INTERFACES_VERSION >= 0x0330)
/* NSCP - API changes for Carbon */
totalBytes->hi = pb.ioVTotalBytes & 0xFFFFFFFF00000000;
totalBytes->lo = pb.ioVTotalBytes & 0x00000000FFFFFFFF;

Просмотреть файл

@ -21,7 +21,7 @@
*/
#include "nsButton.h"
#if TARGET_CARBON
#if TARGET_CARBON || (UNIVERSAL_INTERFACES_VERSION >= 0x0330)
#include <ControlDefinitions.h>
#endif

Просмотреть файл

@ -34,7 +34,7 @@
#include "nsIPlatformCharset.h"
#undef NS_IMPL_IDS
#if TARGET_CARBON
#if TARGET_CARBON || (UNIVERSAL_INTERFACES_VERSION >= 0x0330)
#include <ControlDefinitions.h>
#endif

Просмотреть файл

@ -22,7 +22,7 @@
#include "nsScrollbar.h"
#include "nsIDeviceContext.h"
#if TARGET_CARBON
#if TARGET_CARBON || (UNIVERSAL_INTERFACES_VERSION >= 0x0330)
#include <ControlDefinitions.h>
#endif

Просмотреть файл

@ -25,7 +25,7 @@
#include <Appearance.h>
#include <memory>
#if TARGET_CARBON
#if TARGET_CARBON || (UNIVERSAL_INTERFACES_VERSION >= 0x0330)
#include <ControlDefinitions.h>
#endif

Просмотреть файл

@ -256,8 +256,11 @@ static OSErr PreflightDirectoryCopySpace(short srcVRefNum,
if ( error == noErr )
{
/* Convert freeBytes to free disk blocks (512-byte blocks) */
#if (UNIVERSAL_INTERFACES_VERSION >= 0x0330)
dstFreeBlocks = (pb.ioVFreeBytes >> 9);
#else
dstFreeBlocks = (pb.ioVFreeBytes.hi << 23) + (pb.ioVFreeBytes.lo >> 9);
#endif
/* get allocation block size (always multiple of 512) and divide by 512
to get number of 512-byte blocks per allocation block */
theGlobals.dstBlksPerAllocBlk = ((unsigned long)pb.ioVAlBlkSiz >> 9);

Просмотреть файл

@ -38,6 +38,7 @@
#include <Aliases.h>
#include <Folders.h>
#include <Errors.h>
#include <Math64.h>
#include <TextUtils.h>
#include <Processes.h>
#include <limits.h> // ULONG_MAX
@ -1208,8 +1209,9 @@ PRInt64 nsFileSpec::GetDiskSpaceAvailable() const
if (err == noErr)
{
space64Bits.lo = pb.ioVFreeBytes.lo;
space64Bits.hi = pb.ioVFreeBytes.hi;
const UnsignedWide& freeBytes = UInt64ToUnsignedWide(pb.ioVFreeBytes);
space64Bits.lo = freeBytes.lo;
space64Bits.hi = freeBytes.hi;
}
return space64Bits;

Просмотреть файл

@ -48,6 +48,7 @@
#include <AppleEvents.h>
#include <AEDataModel.h>
#include <Math64.h>
#include <Aliases.h>
#include <Folders.h>
#include "macDirectoryCopy.h"
@ -1628,8 +1629,9 @@ nsLocalFile::GetDiskSpaceAvailable(PRInt64 *aDiskSpaceAvailable)
if (err == noErr)
{
space64Bits.lo = pb.ioVFreeBytes.lo;
space64Bits.hi = pb.ioVFreeBytes.hi;
const UnsignedWide& freeBytes = UInt64ToUnsignedWide(pb.ioVFreeBytes);
space64Bits.lo = freeBytes.lo;
space64Bits.hi = freeBytes.hi;
}
*aDiskSpaceAvailable = space64Bits;

Двоичные данные
xpinstall/wizard/mac/macbuild/MIW.mcp

Двоичный файл не отображается.

Просмотреть файл

@ -33,6 +33,9 @@
#include <MacTypes.h>
#include <PLStringFuncs.h>
#include <Icons.h>
#if TARGET_CARBON || (UNIVERSAL_INTERFACES_VERSION >= 0x0330)
#include <ControlDefinitions.h>
#endif
#include "FullPath.h"
#include "MoreFilesExtras.h"

Просмотреть файл

@ -22,6 +22,7 @@
#include "MacInstallWizard.h"
#include <Math64.h>
/*-----------------------------------------------------------*
* Setup Type Window
@ -475,8 +476,7 @@ DrawDiskSpaceMsgs(short vRefNum)
pb.ioVRefNum = vRefNum;
ERR_CHECK( PBXGetVolInfoSync(&pb) );
freeSpace.hi = pb.ioVFreeBytes.hi;
freeSpace.lo = pb.ioVFreeBytes.lo;
freeSpace = UInt64ToUnsignedWide(pb.ioVFreeBytes);
dFree = (freeSpace.hi * 4294967296) + freeSpace.lo; // 2^32 = 4294967296
lFree = (long) (dFree/1024);