Prevent link error when cross compiling with mingw
authorJohn Darrington <john@darrington.wattle.id.au>
Sun, 20 Mar 2016 18:34:34 +0000 (19:34 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Sun, 20 Mar 2016 18:39:09 +0000 (19:39 +0100)
src/data/spreadsheet-reader.h
src/libpspp/compiler.h

index 0f0819b249bbdf6633acbf65949db236611188bc..37b249d4e9c4af6c4884ac7b7da8b2d4259e6b53 100644 (file)
@@ -18,6 +18,7 @@
 #define SPREADSHEET_READ_H 1
 
 #include <stdbool.h>
+#include <libpspp/compiler.h>
 
 struct casereeader;
 
@@ -76,8 +77,8 @@ struct spreadsheet
 
 struct casereader * spreadsheet_make_reader (struct spreadsheet *, const struct spreadsheet_read_options *);
 
-const char * spreadsheet_get_sheet_name (struct spreadsheet *s, int n);
-char * spreadsheet_get_sheet_range (struct spreadsheet *s, int n);
+const char * spreadsheet_get_sheet_name (struct spreadsheet *s, int n) OPTIMIZE(2);
+char * spreadsheet_get_sheet_range (struct spreadsheet *s, int n) OPTIMIZE(2);
 
 
 char * create_cell_ref (int col0, int row0);
index a7e91bfec1f805b35c8f2c6d15608fcf556bbc68..07b36b8e24d0eb9266c7dfbdc82f6bf6b69f61d0 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2009, 2010, 2016 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #define SENTINEL(IDX)
 #endif
 
+
+/* This attribute indicates that the function should be compiled
+   with the specified LEVEL, regardless of what has been specified
+   on the command line */
+#if __GNUC__ > 3
+#define OPTIMIZE(LEVEL) ATTRIBUTE ((optimize(LEVEL)))
+#else
+#define OPTIMIZE(LEVEL)
+#endif
+
+
 #endif /* compiler.h */