~ubuntu-branches/ubuntu/saucy/gjs/saucy-proposed

« back to all changes in this revision

Viewing changes to gjs/compat.h

  • Committer: Package Import Robot
  • Author(s): Tim Lunn
  • Date: 2013-07-30 09:15:40 UTC
  • mfrom: (1.10.9)
  • Revision ID: package-import@ubuntu.com-20130730091540-7hk361n8pbliyfn2
Tags: 1.37.4-0ubuntu1
* New upstream release (LP: #1205971)
* debian/control.in:
  - Bump b-d on gobject-instropection
  - Build-depend on mozjs17 instead of mozjs
  - Bump library packages to libgjs0d (for mozjs17 transition)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#ifndef __GJS_COMPAT_H__
30
30
#define __GJS_COMPAT_H__
31
31
 
32
 
#pragma GCC diagnostic push
33
 
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
34
 
#pragma GCC diagnostic ignored "-Winvalid-offsetof"
 
32
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
 
33
_Pragma("GCC diagnostic push")
 
34
_Pragma("GCC diagnostic ignored \"-Wstrict-prototypes\"")
 
35
_Pragma("GCC diagnostic ignored \"-Winvalid-offsetof\"")
 
36
#endif
35
37
#include <jsapi.h>
36
38
#include <jsdbgapi.h> // Needed by some bits
37
 
#pragma GCC diagnostic pop
 
39
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
 
40
_Pragma("GCC diagnostic pop")
 
41
#endif
38
42
#include <glib.h>
39
43
 
40
44
#include <gjs/jsapi-util.h>
45
49
 * See https://bugzilla.gnome.org/show_bug.cgi?id=622896 for some initial discussion.
46
50
 */
47
51
 
 
52
#define JSVAL_IS_OBJECT(obj) (JSVAL_IS_NULL(obj) || !JSVAL_IS_PRIMITIVE(obj))
 
53
 
 
54
static JSBool G_GNUC_UNUSED JS_NewNumberValue(JSContext *cx, double d, jsval *rval)
 
55
    {
 
56
        *rval = JS_NumberValue(d);
 
57
        if (JSVAL_IS_NUMBER(*rval))
 
58
            return JS_TRUE;
 
59
        return JS_FALSE;
 
60
    }
 
61
 
48
62
/**
49
63
 * GJS_NATIVE_CONSTRUCTOR_DECLARE:
50
64
 * Prototype a constructor.