[libgweather/wip/hadess/fixes: 2/13] gweather: Remove GWEATHER_EXTERN usage




commit 8c8d515fb55fa898b77cdd2694ff0faca0c08938
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Jan 11 14:26:59 2021 +0100

    gweather: Remove GWEATHER_EXTERN usage

 doc/meson.build                        |  3 +-
 libgweather/gweather-enum-types.h.tmpl |  1 -
 libgweather/gweather-location-entry.h  | 10 ------
 libgweather/gweather-location.c        |  2 +-
 libgweather/gweather-location.h        | 35 ---------------------
 libgweather/gweather-private.h         |  1 -
 libgweather/gweather-timezone-menu.h   |  6 ----
 libgweather/gweather-timezone.h        | 10 ------
 libgweather/gweather-version.h.in      |  4 ---
 libgweather/gweather-weather.h         | 57 ----------------------------------
 meson.build                            | 14 ---------
 11 files changed, 2 insertions(+), 141 deletions(-)
---
diff --git a/doc/meson.build b/doc/meson.build
index 38c9f5fb..c2308cc9 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -23,8 +23,7 @@ gnome.gtkdoc('libgweather',
   ],
   mkdb_args: ['--xml-mode', '--output-format=xml'],
   scan_args: [
-    '--deprecated-guards="GWEATHER_DISABLE_DEPRECATED"',
-    '--ignore-decorators=GWEATHER_EXTERN',
+    '--deprecated-guards="GWEATHER_DISABLE_DEPRECATED"'
   ],
   fixxref_args: [
     '--html-dir=@0@'.format(docpath),
diff --git a/libgweather/gweather-enum-types.h.tmpl b/libgweather/gweather-enum-types.h.tmpl
index d50063da..3624f0a2 100644
--- a/libgweather/gweather-enum-types.h.tmpl
+++ b/libgweather/gweather-enum-types.h.tmpl
@@ -18,7 +18,6 @@ G_BEGIN_DECLS
 /*** END file-production ***/
 
 /*** BEGIN value-header ***/
-GWEATHER_EXTERN
 GType @enum_name@_get_type (void) G_GNUC_CONST;
 #define GWEATHER_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
 /*** END value-header ***/
diff --git a/libgweather/gweather-location-entry.h b/libgweather/gweather-location-entry.h
index 3f5a7f2e..5d7ab63d 100644
--- a/libgweather/gweather-location-entry.h
+++ b/libgweather/gweather-location-entry.h
@@ -50,22 +50,12 @@ struct _GWeatherLocationEntryClass {
     GtkSearchEntryClass parent_class;
 };
 
-GWEATHER_EXTERN
 GType             gweather_location_entry_get_type     (void);
-
-GWEATHER_EXTERN
 GtkWidget        *gweather_location_entry_new          (GWeatherLocation      *top);
-
-GWEATHER_EXTERN
 void              gweather_location_entry_set_location (GWeatherLocationEntry *entry,
                                                        GWeatherLocation      *loc);
-GWEATHER_EXTERN
 GWeatherLocation *gweather_location_entry_get_location (GWeatherLocationEntry *entry);
-
-GWEATHER_EXTERN
 gboolean          gweather_location_entry_has_custom_text (GWeatherLocationEntry *entry);
-
-GWEATHER_EXTERN
 gboolean          gweather_location_entry_set_city     (GWeatherLocationEntry *entry,
                                                        const char            *city_name,
                                                        const char            *code);
diff --git a/libgweather/gweather-location.c b/libgweather/gweather-location.c
index 7d3bb30b..0988ffc7 100644
--- a/libgweather/gweather-location.c
+++ b/libgweather/gweather-location.c
@@ -163,7 +163,7 @@ location_ref_for_idx (GWeatherDb       *db,
 
 static GWeatherDb *world_db;
 
-GWEATHER_EXTERN void
+void
 _gweather_location_reset_world (void)
 {
        gsize i;
diff --git a/libgweather/gweather-location.h b/libgweather/gweather-location.h
index 2f99006b..c44d7c13 100644
--- a/libgweather/gweather-location.h
+++ b/libgweather/gweather-location.h
@@ -46,54 +46,36 @@ typedef enum { /*< underscore_name=gweather_location_level >*/
     GWEATHER_LOCATION_NAMED_TIMEZONE
 } GWeatherLocationLevel;
 
-GWEATHER_EXTERN
 GType gweather_location_get_type (void);
 #define GWEATHER_TYPE_LOCATION (gweather_location_get_type ())
 
-GWEATHER_EXTERN
 GWeatherLocation      *gweather_location_get_world      (void);
-
-GWEATHER_EXTERN
 GWeatherLocation      *gweather_location_ref            (GWeatherLocation  *loc);
-GWEATHER_EXTERN
 void                   gweather_location_unref          (GWeatherLocation  *loc);
 
 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GWeatherLocation, gweather_location_unref);
 
-GWEATHER_EXTERN
 const char            *gweather_location_get_name       (GWeatherLocation  *loc);
-GWEATHER_EXTERN
 const char            *gweather_location_get_sort_name  (GWeatherLocation  *loc);
-GWEATHER_EXTERN
 const char            *gweather_location_get_english_name (GWeatherLocation  *loc);
-GWEATHER_EXTERN
 const char            *gweather_location_get_english_sort_name (GWeatherLocation  *loc);
-GWEATHER_EXTERN
 GWeatherLocationLevel  gweather_location_get_level      (GWeatherLocation  *loc);
-GWEATHER_EXTERN
 GWeatherLocation      *gweather_location_get_parent     (GWeatherLocation  *loc);
 
-GWEATHER_EXTERN
 GWeatherLocation      *gweather_location_next_child     (GWeatherLocation  *loc, GWeatherLocation  *child);
-GWEATHER_EXTERN
 G_DEPRECATED_FOR(gweather_location_next_child)
 GWeatherLocation     **gweather_location_get_children   (GWeatherLocation  *loc);
 
-GWEATHER_EXTERN
 gboolean               gweather_location_has_coords     (GWeatherLocation  *loc);
-GWEATHER_EXTERN
 void                   gweather_location_get_coords     (GWeatherLocation  *loc,
                                                         double            *latitude,
                                                         double            *longitude);
-GWEATHER_EXTERN
 double                 gweather_location_get_distance   (GWeatherLocation  *loc,
                                                         GWeatherLocation  *loc2);
-GWEATHER_EXTERN
 GWeatherLocation      *gweather_location_find_nearest_city (GWeatherLocation *loc,
                                                            double            lat,
                                                            double            lon);
 
-GWEATHER_EXTERN
 GWeatherLocation      *gweather_location_find_nearest_city_full (GWeatherLocation  *loc,
                                                                 double             lat,
                                                                 double             lon,
@@ -101,60 +83,43 @@ GWeatherLocation      *gweather_location_find_nearest_city_full (GWeatherLocatio
                                                                 gpointer           user_data,
                                                                 GDestroyNotify     destroy);
 
-GWEATHER_EXTERN
 void                  gweather_location_detect_nearest_city (GWeatherLocation   *loc,
                                                             double              lat,
                                                             double              lon,
                                                             GCancellable       *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer            user_data);
-GWEATHER_EXTERN
 GWeatherLocation      *gweather_location_detect_nearest_city_finish (GAsyncResult *result, GError **error);
 
-GWEATHER_EXTERN
 const char            *gweather_location_get_country    (GWeatherLocation  *loc);
 
-GWEATHER_EXTERN
 GWeatherTimezone      *gweather_location_get_timezone   (GWeatherLocation  *loc);
-GWEATHER_EXTERN
 const char            *gweather_location_get_timezone_str (GWeatherLocation *loc);
-GWEATHER_EXTERN
 GWeatherTimezone     **gweather_location_get_timezones  (GWeatherLocation  *loc);
-GWEATHER_EXTERN
 void                   gweather_location_free_timezones (GWeatherLocation  *loc,
                                                         GWeatherTimezone **zones);
 
-GWEATHER_EXTERN
 const char            *gweather_location_get_code       (GWeatherLocation  *loc);
-GWEATHER_EXTERN
 char                  *gweather_location_get_city_name  (GWeatherLocation  *loc);
-GWEATHER_EXTERN
 char                  *gweather_location_get_country_name (GWeatherLocation  *loc);
 
-GWEATHER_EXTERN
 GWeatherLocation      *gweather_location_find_by_station_code (GWeatherLocation *world,
                                                               const gchar      *station_code);
-GWEATHER_EXTERN
 GWeatherLocation      *gweather_location_find_by_country_code (GWeatherLocation *world,
                                                               const gchar      *country_code);
 
-GWEATHER_EXTERN
 gboolean               gweather_location_equal          (GWeatherLocation  *one,
                                                         GWeatherLocation  *two);
 
-GWEATHER_EXTERN
 GVariant              *gweather_location_serialize      (GWeatherLocation  *loc);
-GWEATHER_EXTERN
 GWeatherLocation      *gweather_location_deserialize    (GWeatherLocation  *world,
                                                         GVariant          *serialized);
 
-GWEATHER_EXTERN
 GWeatherLocation      *gweather_location_new_detached   (const char        *name,
                                                         const char        *icao,
                                                         gdouble            latitude,
                                                         gdouble            longitude);
 
-GWEATHER_EXTERN
 const char            *gweather_location_level_to_string (GWeatherLocationLevel level);
 
 G_END_DECLS
diff --git a/libgweather/gweather-private.h b/libgweather/gweather-private.h
index 5dbbdca6..9ada3225 100644
--- a/libgweather/gweather-private.h
+++ b/libgweather/gweather-private.h
@@ -194,7 +194,6 @@ struct _GWeatherInfoPrivate {
 #define RADIANS_TO_DEGREES(rad)                ((rad) * 180. / M_PI)
 #define RADIANS_TO_HOURS(rad)          ((rad) * 12. / M_PI)
 
-GWEATHER_EXTERN
 char           *_radians_to_degrees_str (gdouble radians);
 
 /*
diff --git a/libgweather/gweather-timezone-menu.h b/libgweather/gweather-timezone-menu.h
index ed9930a8..b5c4cc55 100644
--- a/libgweather/gweather-timezone-menu.h
+++ b/libgweather/gweather-timezone-menu.h
@@ -50,16 +50,10 @@ struct _GWeatherTimezoneMenuClass {
 
 };
 
-GWEATHER_EXTERN
 GType       gweather_timezone_menu_get_type         (void);
-
-GWEATHER_EXTERN
 GtkWidget  *gweather_timezone_menu_new              (GWeatherLocation     *top);
-
-GWEATHER_EXTERN
 void        gweather_timezone_menu_set_tzid         (GWeatherTimezoneMenu *menu,
                                                     const char           *tzid);
-GWEATHER_EXTERN
 const char *gweather_timezone_menu_get_tzid         (GWeatherTimezoneMenu *menu);
 
 #endif
diff --git a/libgweather/gweather-timezone.h b/libgweather/gweather-timezone.h
index 2368470f..7ee95b8c 100644
--- a/libgweather/gweather-timezone.h
+++ b/libgweather/gweather-timezone.h
@@ -31,31 +31,21 @@ G_BEGIN_DECLS
 
 typedef struct _GWeatherTimezone GWeatherTimezone;
 
-GWEATHER_EXTERN
 GType gweather_timezone_get_type (void);
 #define GWEATHER_TYPE_TIMEZONE (gweather_timezone_get_type ())
 
-GWEATHER_EXTERN
 const char       *gweather_timezone_get_name       (GWeatherTimezone *zone);
-GWEATHER_EXTERN
 const char       *gweather_timezone_get_tzid       (GWeatherTimezone *zone);
-GWEATHER_EXTERN
 int               gweather_timezone_get_offset     (GWeatherTimezone *zone);
-GWEATHER_EXTERN
 gboolean          gweather_timezone_has_dst        (GWeatherTimezone *zone);
-GWEATHER_EXTERN
 int               gweather_timezone_get_dst_offset (GWeatherTimezone *zone);
 
-GWEATHER_EXTERN
 GWeatherTimezone *gweather_timezone_ref            (GWeatherTimezone *zone);
-GWEATHER_EXTERN
 void              gweather_timezone_unref          (GWeatherTimezone *zone);
 
 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GWeatherTimezone, gweather_timezone_unref);
 
-GWEATHER_EXTERN
 GWeatherTimezone *gweather_timezone_get_utc        (void);
-GWEATHER_EXTERN
 GWeatherTimezone *gweather_timezone_get_by_tzid    (const char *tzid);
 
 G_END_DECLS
diff --git a/libgweather/gweather-version.h.in b/libgweather/gweather-version.h.in
index fd5cc3fb..c5bc44cc 100644
--- a/libgweather/gweather-version.h.in
+++ b/libgweather/gweather-version.h.in
@@ -28,10 +28,6 @@
 #error "gweather-version.h must not be included individually, include gweather.h instead"
 #endif
 
-#ifndef GWEATHER_EXTERN
-#define GWEATHER_EXTERN extern
-#endif
-
 /**
  * SECTION:gweatherversion
  * @short_description: libgweather version checking
diff --git a/libgweather/gweather-weather.h b/libgweather/gweather-weather.h
index 2c34a4a2..9e112df8 100644
--- a/libgweather/gweather-weather.h
+++ b/libgweather/gweather-weather.h
@@ -75,84 +75,49 @@ struct _GWeatherInfoClass {
     void (*updated) (GWeatherInfo *info);
 };
 
-GWEATHER_EXTERN
 GType                    gweather_info_get_type            (void) G_GNUC_CONST;
-GWEATHER_EXTERN
 GWeatherInfo *           gweather_info_new                 (GWeatherLocation *location);
-GWEATHER_EXTERN
 void                     gweather_info_update              (GWeatherInfo *info);
-GWEATHER_EXTERN
 void                    gweather_info_abort               (GWeatherInfo *info);
-GWEATHER_EXTERN
 void                     gweather_info_store_cache         (void);
 
-GWEATHER_EXTERN
 GWeatherProvider         gweather_info_get_enabled_providers (GWeatherInfo        *info);
-GWEATHER_EXTERN
 void                     gweather_info_set_enabled_providers (GWeatherInfo        *info,
                                                              GWeatherProvider     providers);
 
-GWEATHER_EXTERN
 gboolean                gweather_info_is_valid            (GWeatherInfo *info);
-GWEATHER_EXTERN
 gboolean                gweather_info_network_error       (GWeatherInfo *info);
 
-GWEATHER_EXTERN
 const GWeatherLocation * gweather_info_get_location       (GWeatherInfo *info);
-GWEATHER_EXTERN
 void                     gweather_info_set_location        (GWeatherInfo *info,
                                                            GWeatherLocation *location);
-GWEATHER_EXTERN
 gchar *                         gweather_info_get_location_name   (GWeatherInfo *info);
-GWEATHER_EXTERN
 gchar *                 gweather_info_get_update          (GWeatherInfo *info);
-GWEATHER_EXTERN
 gchar *                 gweather_info_get_sky             (GWeatherInfo *info);
-GWEATHER_EXTERN
 gchar *                         gweather_info_get_conditions      (GWeatherInfo *info);
 
-GWEATHER_EXTERN
 gchar *                 gweather_info_get_temp            (GWeatherInfo *info);
-GWEATHER_EXTERN
 gchar *                 gweather_info_get_temp_min        (GWeatherInfo *info);
-GWEATHER_EXTERN
 gchar *                 gweather_info_get_temp_max        (GWeatherInfo *info);
-GWEATHER_EXTERN
 gchar *                 gweather_info_get_dew             (GWeatherInfo *info);
-GWEATHER_EXTERN
 gchar *                 gweather_info_get_humidity        (GWeatherInfo *info);
-GWEATHER_EXTERN
 gchar *                 gweather_info_get_wind            (GWeatherInfo *info);
-GWEATHER_EXTERN
 gchar *                 gweather_info_get_pressure        (GWeatherInfo *info);
-GWEATHER_EXTERN
 gchar *                 gweather_info_get_visibility      (GWeatherInfo *info);
-GWEATHER_EXTERN
 gchar *                 gweather_info_get_apparent        (GWeatherInfo *info);
-GWEATHER_EXTERN
 gchar *                 gweather_info_get_sunrise         (GWeatherInfo *info);
-GWEATHER_EXTERN
 gchar *                 gweather_info_get_sunset          (GWeatherInfo *info);
-GWEATHER_EXTERN
 GSList *                gweather_info_get_forecast_list   (GWeatherInfo *info);
-GWEATHER_EXTERN
 GdkPixbufAnimation *    gweather_info_get_radar           (GWeatherInfo *info);
-GWEATHER_EXTERN
 const gchar             *gweather_info_get_attribution     (GWeatherInfo *info);
 
-GWEATHER_EXTERN
 gchar *                 gweather_info_get_temp_summary    (GWeatherInfo *info);
-GWEATHER_EXTERN
 gchar *                         gweather_info_get_weather_summary (GWeatherInfo *info);
 
-GWEATHER_EXTERN
 const gchar *           gweather_info_get_icon_name       (GWeatherInfo *info);
-GWEATHER_EXTERN
 const gchar *           gweather_info_get_symbolic_icon_name      (GWeatherInfo *info);
-GWEATHER_EXTERN
 gint                    gweather_info_next_sun_event      (GWeatherInfo *info);
 
-GWEATHER_EXTERN
 gboolean                 gweather_info_is_daytime          (GWeatherInfo *info);
 
 /* values retrieving functions */
@@ -205,9 +170,7 @@ typedef enum { /*< underscore_name=gweather_wind_direction >*/
     GWEATHER_WIND_LAST
 } GWeatherWindDirection;
 
-GWEATHER_EXTERN
 const gchar * gweather_wind_direction_to_string (GWeatherWindDirection wind);
-GWEATHER_EXTERN
 const gchar * gweather_wind_direction_to_string_full (GWeatherWindDirection wind,
                                                       GWeatherFormatOptions options);
 
@@ -236,9 +199,7 @@ typedef enum { /*< underscore_name=gweather_sky >*/
     GWEATHER_SKY_LAST
 } GWeatherSky;
 
-GWEATHER_EXTERN
 const gchar * gweather_sky_to_string (GWeatherSky sky);
-GWEATHER_EXTERN
 const gchar * gweather_sky_to_string_full (GWeatherSky        sky,
                                            GWeatherFormatOptions options);
 
@@ -354,35 +315,20 @@ typedef gdouble GWeatherMoonPhase;
  */
 typedef gdouble GWeatherMoonLatitude;
 
-GWEATHER_EXTERN
 gboolean gweather_info_get_value_update                (GWeatherInfo *info, time_t *value);
-GWEATHER_EXTERN
 gboolean gweather_info_get_value_sky           (GWeatherInfo *info, GWeatherSky *sky);
-GWEATHER_EXTERN
 gboolean gweather_info_get_value_conditions    (GWeatherInfo *info, GWeatherConditionPhenomenon *phenomenon, 
GWeatherConditionQualifier *qualifier);
-GWEATHER_EXTERN
 gboolean gweather_info_get_value_temp          (GWeatherInfo *info, GWeatherTemperatureUnit unit, gdouble 
*value);
-GWEATHER_EXTERN
 gboolean gweather_info_get_value_temp_min      (GWeatherInfo *info, GWeatherTemperatureUnit unit, gdouble 
*value);
-GWEATHER_EXTERN
 gboolean gweather_info_get_value_temp_max      (GWeatherInfo *info, GWeatherTemperatureUnit unit, gdouble 
*value);
-GWEATHER_EXTERN
 gboolean gweather_info_get_value_dew           (GWeatherInfo *info, GWeatherTemperatureUnit unit, gdouble 
*value);
-GWEATHER_EXTERN
 gboolean gweather_info_get_value_apparent      (GWeatherInfo *info, GWeatherTemperatureUnit unit, gdouble 
*value);
-GWEATHER_EXTERN
 gboolean gweather_info_get_value_wind          (GWeatherInfo *info, GWeatherSpeedUnit unit, gdouble *speed, 
GWeatherWindDirection *direction);
-GWEATHER_EXTERN
 gboolean gweather_info_get_value_pressure      (GWeatherInfo *info, GWeatherPressureUnit unit, gdouble 
*value);
-GWEATHER_EXTERN
 gboolean gweather_info_get_value_visibility    (GWeatherInfo *info, GWeatherDistanceUnit unit, gdouble 
*value);
-GWEATHER_EXTERN
 gboolean gweather_info_get_value_sunrise       (GWeatherInfo *info, time_t *value);
-GWEATHER_EXTERN
 gboolean gweather_info_get_value_sunset        (GWeatherInfo *info, time_t *value);
-GWEATHER_EXTERN
 gboolean gweather_info_get_value_moonphase      (GWeatherInfo *info, GWeatherMoonPhase *value, 
GWeatherMoonLatitude *lat);
-GWEATHER_EXTERN
 gboolean gweather_info_get_upcoming_moonphases  (GWeatherInfo *info, time_t *phases);
 
 typedef struct _GWeatherConditions GWeatherConditions;
@@ -409,13 +355,10 @@ struct _GWeatherConditions {
     GWeatherConditionQualifier qualifier;
 };
 
-GWEATHER_EXTERN
 const gchar * gweather_conditions_to_string (GWeatherConditions *conditions);
-GWEATHER_EXTERN
 const gchar * gweather_conditions_to_string_full (GWeatherConditions *conditions,
                                                   GWeatherFormatOptions options);
 
-GWEATHER_EXTERN
 GWeatherTemperatureUnit gweather_temperature_unit_to_real (GWeatherTemperatureUnit unit);
 
 G_END_DECLS
diff --git a/meson.build b/meson.build
index 527e2dee..bc653961 100644
--- a/meson.build
+++ b/meson.build
@@ -81,20 +81,6 @@ endif
 config_h.set_quoted('ZONEINFO_DIR', get_option('zoneinfo_dir'))
 config_h.set_quoted('OWM_APIKEY', get_option('owm_apikey'))
 
-if get_option('default_library') != 'static'
-  if host_machine.system() == 'windows'
-    config_h.set('DLL_EXPORT', true)
-    config_h.set('GWEATHER_EXTERN', '__declspec(dllexport) extern')
-    if cc.get_id() != 'msvc'
-      add_project_arguments(['-fvisibility=hidden'], language: 'c')
-    endif
-  else
-    config_h.set('GWEATHER_EXTERN', '__attribute__((visibility("default"))) extern')
-    add_project_arguments(['-fvisibility=hidden'], language: 'c')
-  endif
-endif
-
-
 configure_file(
   output: 'config.h',
   configuration: config_h,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]