Commit 9b9542a6 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

removed gimp_foo_version variables.

2006-11-28  Michael Natterer  <mitch@gimp.org>

	* libgimp/gimp.[ch]: removed gimp_foo_version variables.

	* libgimpbase/gimpenv.[ch]: added them here.

	* app/sanity.c: added sanity_check_gimp() and abort if the libgimp
	version gimp is compiled with is not exactly the same we encounter
	at runtime.
parent 473c0c01
2006-11-28 Michael Natterer <mitch@gimp.org>
* libgimp/gimp.[ch]: removed gimp_foo_version variables.
* libgimpbase/gimpenv.[ch]: added them here.
* app/sanity.c: added sanity_check_gimp() and abort if the libgimp
version gimp is compiled with is not exactly the same we encounter
at runtime.
2006-11-28 Manish Singh <yosh@gimp.org>
* plug-ins/pygimp/pygimp-api.h
......
......@@ -22,13 +22,14 @@
#include <fontconfig/fontconfig.h>
#include <pango/pangoft2.h>
#include "libgimpbase/gimpenv.h"
#include "libgimpbase/gimpbase.h"
#include "sanity.h"
#include "gimp-intl.h"
static gchar * sanity_check_gimp (void);
static gchar * sanity_check_glib (void);
static gchar * sanity_check_fontconfig (void);
static gchar * sanity_check_freetype (void);
......@@ -40,7 +41,10 @@ static gchar * sanity_check_filename_encoding (void);
const gchar *
sanity_check (void)
{
gchar *abort_message = sanity_check_glib ();
gchar *abort_message = sanity_check_gimp ();
if (! abort_message)
abort_message = sanity_check_glib ();
if (! abort_message)
abort_message = sanity_check_fontconfig ();
......@@ -57,6 +61,26 @@ sanity_check (void)
/* private functions */
static gchar *
sanity_check_gimp (void)
{
if (GIMP_MAJOR_VERSION != gimp_major_version ||
GIMP_MINOR_VERSION != gimp_minor_version ||
GIMP_MICRO_VERSION != gimp_micro_version)
{
return g_strdup_printf
("Libgimp version mismatch!\n\n"
"The GIMP binary cannot run with a libgimp version\n"
"other than its own. This is GIMP %d.%d.%d, but the\n"
"libgimp version is %d.%d.%d.\n\n"
"Maybe you have GIMP versions in both /usr and /usr/local ?",
GIMP_MAJOR_VERSION, GIMP_MINOR_VERSION, GIMP_MICRO_VERSION,
gimp_major_version, gimp_minor_version, gimp_micro_version);
}
return NULL;
}
static gchar *
sanity_check_glib (void)
{
......
......@@ -93,10 +93,6 @@
#include <libintl.h>
#include <locale.h>
#ifndef LIBGIMP_COMPILATION
#define LIBGIMP_COMPILATION
#endif
#include "libgimpbase/gimpbasetypes.h"
#include "libgimpbase/gimpbase-private.h"
......@@ -163,10 +159,6 @@ static gboolean gimp_extension_read (GIOChannel *channel,
static GIOChannel *_readchannel = NULL;
GIOChannel *_writechannel = NULL;
const guint gimp_major_version = GIMP_MAJOR_VERSION;
const guint gimp_minor_version = GIMP_MINOR_VERSION;
const guint gimp_micro_version = GIMP_MICRO_VERSION;
#ifdef USE_WIN32_SHM
static HANDLE shm_handle;
#endif
......
......@@ -59,16 +59,10 @@
#include <libgimp/gimp_pdb.h>
#ifdef G_OS_WIN32
# include <stdlib.h> /* For __argc and __argv */
# ifdef LIBGIMP_COMPILATION
# define GIMPVAR __declspec(dllexport)
# else /* !LIBGIMP_COMPILATION */
# define GIMPVAR extern __declspec(dllimport)
# endif /* !LIBGIMP_COMPILATION */
#else /* !G_OS_WIN32 */
# define GIMPVAR extern
#include <stdlib.h> /* For __argc and __argv */
#endif
G_BEGIN_DECLS
......@@ -77,11 +71,6 @@ G_BEGIN_DECLS
#define gimp_set_data gimp_procedural_db_set_data
GIMPVAR const guint gimp_major_version;
GIMPVAR const guint gimp_minor_version;
GIMPVAR const guint gimp_micro_version;
typedef void (* GimpInitProc) (void);
typedef void (* GimpQuitProc) (void);
typedef void (* GimpQueryProc) (void);
......
......@@ -32,6 +32,10 @@
#include <glib.h>
#include <glib/gstdio.h>
#ifndef LIBGIMP_COMPILATION
#define LIBGIMP_COMPILATION
#endif
#include "gimpenv.h"
#include "gimpversion.h"
#include "gimpreloc.h"
......@@ -59,10 +63,16 @@
#define getegid() 0
#endif
static gchar * gimp_env_get_dir (const gchar *gimp_env_name,
const gchar *env_dir);
const guint gimp_major_version = GIMP_MAJOR_VERSION;
const guint gimp_minor_version = GIMP_MINOR_VERSION;
const guint gimp_micro_version = GIMP_MICRO_VERSION;
/**
* gimp_env_init:
* @plug_in: must be %TRUE if this function is called from a plug-in
......
......@@ -29,10 +29,25 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
#ifdef G_OS_WIN32
# ifdef LIBGIMP_COMPILATION
# define GIMPVAR __declspec(dllexport)
# else /* !LIBGIMP_COMPILATION */
# define GIMPVAR extern __declspec(dllimport)
# endif /* !LIBGIMP_COMPILATION */
#else /* !G_OS_WIN32 */
# define GIMPVAR extern
#endif
GIMPVAR const guint gimp_major_version;
GIMPVAR const guint gimp_minor_version;
GIMPVAR const guint gimp_micro_version;
const gchar * gimp_directory (void) G_GNUC_CONST;
const gchar * gimp_data_directory (void) G_GNUC_CONST;
const gchar * gimp_locale_directory (void) G_GNUC_CONST;
const gchar * gimp_sysconf_directory (void) G_GNUC_CONST;
const gchar * gimp_locale_directory (void) G_GNUC_CONST;
const gchar * gimp_sysconf_directory (void) G_GNUC_CONST;
const gchar * gimp_plug_in_directory (void) G_GNUC_CONST;
const gchar * gimp_gtkrc (void) G_GNUC_CONST;
gchar * gimp_personal_rc_file (const gchar *basename) G_GNUC_MALLOC;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment