Closed Bug 714312 Opened 12 years ago Closed 12 years ago

detect machine/endian.h to get endianess on BSD systems

Categories

(Core :: JavaScript Engine, defect)

x86
OpenBSD
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla12

People

(Reporter: gaston, Assigned: gaston)

Details

Attachments

(1 file, 1 obsolete file)

Followup to bug #694499, endianess detection fails now on OpenBSD (and probably Net/Free too), since include/endian.h doesn't exist there. A common denominator is to include machine/endian.h, which defines _BYTE_ORDER (directly, or via another inclusion). Note that on OpenBSD, we need to include sys/types.h first.
Attached patch Detect and use machine/endian.h (obsolete) — Splinter Review
Proposed configure.in/jscpucfg.h/config.h.in patch to check and use machine/endian.h, tested on OpenBSD, probably works on Net/Free.
Assignee: general → landry
Attachment #584993 - Flags: review?(ted.mielczarek)
It was reported on IRC that adding this patch is sufficient to get current trunk to work on OpenBSD.  Perhaps a higher priority is therefore appropriate?
Comment on attachment 584993 [details] [diff] [review]
Detect and use machine/endian.h

Review of attachment 584993 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with one style nit.

::: js/src/configure.in
@@ +2948,5 @@
>  if test "$ac_cv_header_endian_h" = yes; then
>      AC_DEFINE(JS_HAVE_ENDIAN_H)
>  fi
>  
> +MOZ_CHECK_HEADER([machine/endian.h],[AC_DEFINE(JS_HAVE_MACHINE_ENDIAN_H)],[],[#include <sys/types.h>])

Can you write this check in the same style as the surrounding checks?
Attachment #584993 - Flags: review?(ted.mielczarek) → review+
Assuming that's what you meant, here's a new one with :

MOZ_CHECK_HEADERS([machine/endian.h],[],[],[#include <sys/types.h>])
if test "$ac_cv_header_machine_endian_h" = yes; then
    AC_DEFINE(JS_HAVE_MACHINE_ENDIAN_H)
fi
Attachment #584993 - Attachment is obsolete: true
Attachment #587078 - Flags: review?(ted.mielczarek)
Comment on attachment 587078 [details] [diff] [review]
Detect and use machine/endian.h

Review of attachment 587078 [details] [diff] [review]:
-----------------------------------------------------------------

Yeah, thanks!
Attachment #587078 - Flags: review?(ted.mielczarek) → review+
Keywords: checkin-needed
https://hg.mozilla.org/integration/mozilla-inbound/rev/9cfdb612a026

In the future, it'd help if you could make sure to include the bug number in the patch.  (Some people will also want the r=... in it as well.  Seeing as the reviewed version can't have that except anticipatorily, I'm happy to take 'em as they come on that point, myself.  :-) )
Status: NEW → ASSIGNED
Keywords: checkin-needed
Target Milestone: --- → mozilla12
https://hg.mozilla.org/mozilla-central/rev/9cfdb612a026
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: