We need to ensure that libsigrokdecode.h is always the first #include,
otherwise some versions of Python will cause all kinds of compiler
warnings like these:
CC device.o
In file included from /usr/include/python3.2mu/Python.h:8:0,
from [...]/include/libsigrokdecode/libsigrokdecode.h:25,
from sigrok-cli.h:26,
from device.c:23:
/usr/include/python3.2mu/pyconfig.h:1182:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default]
#define _POSIX_C_SOURCE 200112L
^
In file included from /usr/include/limits.h:26:0,
from /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed/limits.h:168,
from /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed/syslimits.h:7,
from /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed/limits.h:34,
from /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h:11,
from /usr/include/glib-2.0/glib/gtypes.h:34,
from /usr/include/glib-2.0/glib/galloca.h:34,
from /usr/include/glib-2.0/glib.h:32,
from device.c:21:
/usr/include/features.h:231:0: note: this is the location of the previous definition
# define _POSIX_C_SOURCE 200809L
^
Since sigrok-cli.h already #includes libsigrok.h and libsigrokdecode.h,
just ensure that the latter is always the first #include by _only_
including it in sigrok-cli.h and nowhere else.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#ifdef _WIN32
#include <windows.h>
#include <stdio.h>
#ifdef _WIN32
#include <windows.h>
#include <unistd.h>
#include <string.h>
#include <glib.h>
#include <unistd.h>
#include <string.h>
#include <glib.h>
-#include <libsigrok/libsigrok.h>
-#include "sigrok-cli.h"
#ifdef _WIN32
static HANDLE stdin_handle;
#ifdef _WIN32
static HANDLE stdin_handle;
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <glib.h>
#include "config.h"
#include <glib.h>
-#include <libsigrok/libsigrok.h>
-#ifdef HAVE_SRD
-#include <libsigrokdecode/libsigrokdecode.h> /* First, so we avoid a _POSIX_C_SOURCE warning. */
-#endif
-#include "sigrok-cli.h"
#ifdef HAVE_SRD
static GHashTable *pd_ann_visible = NULL;
#ifdef HAVE_SRD
static GHashTable *pd_ann_visible = NULL;
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <glib.h>
#include "config.h"
#include <glib.h>
-#include <libsigrok/libsigrok.h>
-#include "sigrok-cli.h"
extern struct sr_context *sr_ctx;
extern gchar *opt_drv;
extern struct sr_context *sr_ctx;
extern gchar *opt_drv;
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <glib.h>
#include "config.h"
#include <glib.h>
-#include <libsigrok/libsigrok.h>
-#include "sigrok-cli.h"
extern gchar *opt_input_file;
extern gchar *opt_input_format;
extern gchar *opt_input_file;
extern gchar *opt_input_format;
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <glib.h>
#include "config.h"
#include <glib.h>
-#include <libsigrok/libsigrok.h>
-#ifdef HAVE_SRD
-#include <libsigrokdecode/libsigrokdecode.h> /* First, so we avoid a _POSIX_C_SOURCE warning. */
-#endif
-#include "sigrok-cli.h"
struct sr_context *sr_ctx = NULL;
#ifdef HAVE_SRD
struct sr_context *sr_ctx = NULL;
#ifdef HAVE_SRD
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <glib.h>
-#include <libsigrok/libsigrok.h>
-#include "sigrok-cli.h"
static struct sr_probe *find_probe(GSList *probelist, const char *probename)
{
static struct sr_probe *find_probe(GSList *probelist, const char *probename)
{
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <glib.h>
#include <glib/gstdio.h>
#include "config.h"
#include <glib.h>
#include <glib/gstdio.h>
-#include <libsigrok/libsigrok.h>
-#ifdef HAVE_SRD
-#include <libsigrokdecode/libsigrokdecode.h> /* First, so we avoid a _POSIX_C_SOURCE warning. */
-#endif
-#include "sigrok-cli.h"
static struct sr_output_format *output_format = NULL;
static int default_output_format = FALSE;
static struct sr_output_format *output_format = NULL;
static int default_output_format = FALSE;
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <glib.h>
#include "config.h"
#include <glib.h>
-#include <libsigrok/libsigrok.h>
-#ifdef HAVE_SRD
-#include <libsigrokdecode/libsigrokdecode.h>
-#endif
-#include "sigrok-cli.h"
extern gint opt_loglevel;
extern gchar *opt_pds;
extern gint opt_loglevel;
extern gchar *opt_pds;
#define SIGROK_CLI_SIGROK_CLI_H
#include "config.h"
#define SIGROK_CLI_SIGROK_CLI_H
#include "config.h"
-#include <libsigrok/libsigrok.h>
+/* First, so we avoid a _POSIX_C_SOURCE warning. */
#include <libsigrokdecode/libsigrokdecode.h>
#endif
#include <libsigrokdecode/libsigrokdecode.h>
#endif
+#include <libsigrok/libsigrok.h>
#define DEFAULT_OUTPUT_FORMAT "bits:width=64"
#define DEFAULT_OUTPUT_FORMAT "bits:width=64"