From: John Darrington Date: Sun, 20 Mar 2016 18:34:34 +0000 (+0100) Subject: Prevent link error when cross compiling with mingw X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=481ee9c1ac4e7adf004313e689830b7052e61429;p=pspp Prevent link error when cross compiling with mingw --- diff --git a/src/data/spreadsheet-reader.h b/src/data/spreadsheet-reader.h index 0f0819b249..37b249d4e9 100644 --- a/src/data/spreadsheet-reader.h +++ b/src/data/spreadsheet-reader.h @@ -18,6 +18,7 @@ #define SPREADSHEET_READ_H 1 #include +#include 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); diff --git a/src/libpspp/compiler.h b/src/libpspp/compiler.h index a7e91bfec1..07b36b8e24 100644 --- a/src/libpspp/compiler.h +++ b/src/libpspp/compiler.h @@ -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 @@ -87,4 +87,15 @@ #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 */