e6a2a537ce196ff5770520283ee71626ccbdc978
[openembedded.git] /
1 Index: trunk/src/nm-device-ethernet.c
2 ===================================================================
3 --- trunk.orig/src/nm-device-ethernet.c 2008-08-21 18:44:59.000000000 -0300
4 +++ trunk/src/nm-device-ethernet.c      2008-08-21 18:44:59.000000000 -0300
5 @@ -28,6 +28,10 @@
6  #include <net/ethernet.h>
7  #include <stdlib.h>
8  #include <linux/sockios.h>
9 +typedef unsigned long long u64;
10 +typedef unsigned int u32;
11 +typedef unsigned short u16;
12 +typedef unsigned char u8;
13  #include <linux/ethtool.h>
14  #include <sys/ioctl.h>
15  #include <unistd.h>
16 Index: trunk/src/nm-device-wifi.c
17 ===================================================================
18 --- trunk.orig/src/nm-device-wifi.c     2008-08-21 18:54:24.000000000 -0300
19 +++ trunk/src/nm-device-wifi.c  2008-08-21 19:17:17.000000000 -0300
20 @@ -165,6 +165,9 @@
21         gboolean                has_scan_capa_ssid;
22  };
23  
24 +#define g_warn_if_fail(expr)    do { if G_LIKELY (expr) ; else \
25 +                                       g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, #expr); } while (0)
26 +
27  static guint32 nm_device_wifi_get_frequency (NMDeviceWifi *self);
28  
29  static void nm_device_wifi_set_ssid (NMDeviceWifi *self, const GByteArray * ssid);
30 @@ -220,6 +223,27 @@
31                                        const GValue *handler_return,
32                                        gpointer data);
33  
34 +void
35 +g_warn_message (const char     *domain,
36 +                const char     *file,
37 +                int             line,
38 +                const char     *func,
39 +                const char     *warnexpr)
40 +{
41 +  char *s, lstr[32];
42 +  g_snprintf (lstr, 32, "%d", line);
43 +  if (warnexpr)
44 +    s = g_strconcat ("(", file, ":", lstr, "):",
45 +                     func, func[0] ? ":" : "",
46 +                     " runtime check failed: (", warnexpr, ")", NULL);
47 +  else
48 +    s = g_strconcat ("(", file, ":", lstr, "):",
49 +                     func, func[0] ? ":" : "",
50 +                     " ", "code should not be reached", NULL);
51 +  g_log (domain, G_LOG_LEVEL_WARNING, "%s", s);
52 +  g_free (s);
53 +}
54 +
55  static GQuark
56  nm_wifi_error_quark (void)
57  {