Skip to content

Commit 8423c31

Browse files
committed
Let x option synopsis be printed in grdfilter independently of having OMP or not.
1 parent 5bc923f commit 8423c31

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

src/gmt_dev.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ struct GMT_CTRL; /* forward declaration of GMT_CTRL */
154154
#include "gmt_nan.h" /* Machine-dependent macros for making and testing NaNs */
155155
#include "gmt_error.h" /* Only contains error codes */
156156
#include "gmt_synopsis.h" /* Only contains macros for synopsis lines */
157+
#include "gmt_glib.h" /* Make the GMT_xg_OPT define visible, even if HAVE_GLIB_GTHREAD is not defined */
157158
#include "gmt_version.h" /* Only contains the current GMT version number */
158159
#include "gmt_project.h" /* Define GMT->current.proj and GMT->current.map.frame structures */
159160
#include "gmt_grd.h" /* Define grd file header structure */

src/gmt_glib.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
These are used only GLIB based multi-threading */
3131

3232
#ifndef GMT_GLIB_H
33+
#define GMT_GLIB_H
3334

3435
#ifdef HAVE_GLIB_GTHREAD
3536
#include <glib.h>

src/gmt_init.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8124,9 +8124,9 @@ void gmtlib_explain_options (struct GMT_CTRL *GMT, char *options) {
81248124

81258125
#if defined(GMT_MP_ENABLED)
81268126
case 'y': /* Number of threads (reassigned from -x in GMT_Option) */
8127-
if (strlen (GMT_x_OPT) > 1) { /* Only print this if it is in fact available */
8127+
if (strlen(GMT_x_OPT) > 1 || strlen(GMT_xg_OPT) > 1) { /* Only print this if it is in fact available */
81288128
cores = gmtlib_get_num_processors();
8129-
GMT_Usage (API, 1, "\n%s", GMT_x_OPT);
8129+
(strlen(GMT_x_OPT) > 1) ? GMT_Usage(API, 1, "\n%s", GMT_x_OPT) : GMT_Usage(API, 1, "\n%s", GMT_xg_OPT);
81308130
GMT_Usage (API, -2, "Limit the number of cores used in multi-threaded algorithms [Default uses all %d cores]. "
81318131
"If <n> is negative then we select (%d - <n>) cores (or at least 1).", cores, cores);
81328132
}

src/grdfilter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Use option -x to set the number of threads. e.g. -x2, -x4, ... or -xa to use all
4747

4848
#include "gmt_dev.h"
4949
#include "longopt/grdfilter_inc.h"
50-
#include "gmt_glib.h"
50+
//#include "gmt_glib.h" /* Now included in gmt_dev.h */
5151

5252
#define THIS_MODULE_CLASSIC_NAME "grdfilter"
5353
#define THIS_MODULE_MODERN_NAME "grdfilter"

0 commit comments

Comments
 (0)