Closed Bug 479382 Opened 15 years ago Closed 15 years ago

libmar doesn't build on windows ce (uses posix file io)

Categories

(Core :: General, defect)

ARM
Windows CE
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: blassey, Assigned: blassey)

References

Details

(Keywords: fixed1.9.1)

Attachments

(1 file, 1 obsolete file)

      No description provided.
Attached patch gets us building on wince (obsolete) — Splinter Review
Assignee: nobody → bugmail
Attachment #363642 - Flags: review?(benjamin)
I know I've said it before, but maybe we should think about creating a first class library that emulates these basic CRT function instead of putting preprocessor cruft all through the codebase.
nspr would be a good place for such basic CRT functions -- inlined, even.
Except that libmar can't depend on NSPR...
Comment on attachment 363642 [details] [diff] [review]
gets us building on wince

>diff --git a/modules/libmar/src/mar_create.c b/modules/libmar/src/mar_create.c

>+#ifdef WINCE
>+    flags = (file_data.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ?
>+      0x0444 : 0x666;

These flags don't look right. Don't you mean 0444, not 0x0444 ? Permissions are typically written in octal, not hex.

>+    size = (file_data.nFileSizeHigh * MAXDWORD) + file_data.nFileSizeLow;

I think you want file_data.nFileSizeHigh * (MAXDWORD + 1) + file_data.nFileSizeLow; 

>diff --git a/modules/libmar/src/mar_extract.c b/modules/libmar/src/mar_extract.c

> /* Ensure that the directory containing this file exists */
> static int mar_ensure_parent_dir(const char *path)
> {
>   char *slash = strrchr(path, '/');
>+#ifdef WINCE
>+  unsigned short wide_path[MAX_PATH];

use wchar_t or WCHAR
Attachment #363642 - Flags: review?(benjamin) → review-
(In reply to comment #5)
> 
> >+    size = (file_data.nFileSizeHigh * MAXDWORD) + file_data.nFileSizeLow;
> 
> I think you want file_data.nFileSizeHigh * (MAXDWORD + 1) +
> file_data.nFileSizeLow; 

"The size of the file is equal to (nFileSizeHigh * MAXDWORD) + nFileSizeLow."
according to: http://msdn.microsoft.com/en-us/library/ms915521.aspx

and "The size of the file is equal to (nFileSizeHigh * (MAXDWORD+1)) + nFileSizeLow."
according to: http://msdn.microsoft.com/en-us/library/aa365740%28VS.85%29.aspx

The former is windows ce documentation, and the later is Win32 desktop.  

I'm going to assume the former is a typo, since the later makes more sense.
Attachment #363642 - Attachment is obsolete: true
Attachment #365993 - Flags: review?(benjamin)
Attachment #365993 - Flags: review?(benjamin) → review+
Comment on attachment 365993 [details] [diff] [review]
patch v.2
[Checkin: Comment 8]


http://hg.mozilla.org/mozilla-central/rev/0720a4f0eeec
Attachment #365993 - Attachment description: patch v.2 → patch v.2 [Checkin: Comment 8]
Status: NEW → RESOLVED
Closed: 15 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2a1
Version: unspecified → Trunk
Attachment #365993 - Flags: approval1.9.1?
Comment on attachment 365993 [details] [diff] [review]
patch v.2
[Checkin: Comment 8]

a191=beltzner
Attachment #365993 - Flags: approval1.9.1? → approval1.9.1+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: