add a -DGIMP_COMPILATION so cpercep can optionally include glib.h. This

2001-02-17  Manish Singh  <yosh@gimp.org>

        * app/core/Makefile.am: add a -DGIMP_COMPILATION so cpercep can
        optionally include glib.h. This needs to be done in the makefile.msc
        too, but I'm unsure on the right way to do that.

        * app/core/cpercep.c: guard #include <glib.h> in GIMP_COMPILATION.
        cbrt() is a GNU extension, so define in terms of pow if we aren't
        on glibc. Guard CLAMP against redefinition.

        * plug-ins/gfig/gfig.c
        * plug-ins/gflare/gflare.c
        * plug-ins/gimpressionist/gimpressionist.c: make them build again
This commit is contained in:
Manish Singh 2002-02-17 18:28:47 +00:00 committed by Manish Singh
parent a578d9cf58
commit 193ff9d32b
7 changed files with 49 additions and 26 deletions

View File

@ -1,3 +1,17 @@
2001-02-17 Manish Singh <yosh@gimp.org>
* app/core/Makefile.am: add a -DGIMP_COMPILATION so cpercep can
optionally include glib.h. This needs to be done in the makefile.msc
too, but I'm unsure on the right way to do that.
* app/core/cpercep.c: guard #include <glib.h> in GIMP_COMPILATION.
cbrt() is a GNU extension, so define in terms of pow if we aren't
on glibc. Guard CLAMP against redefinition.
* plug-ins/gfig/gfig.c
* plug-ins/gflare/gflare.c
* plug-ins/gimpressionist/gimpressionist.c: make them build again
2001-02-17 Hans Breuer <hans@breuer.org>
* */*/makefile.msc */makefile.msc : from now on use

View File

@ -57,12 +57,14 @@ from the Author.
#include <stdlib.h>
#include <math.h>
#ifdef _MSC_VER
/* msvc does not now cbrt() is it nonstandard ? */
#ifndef __GLIBC__
/* cbrt() is a GNU extension */
#define cbrt(x) (pow(x, 1.0/3.0))
#endif
#ifdef GIMP_COMPILATION
#include <glib.h> /* to get working 'inline' */
#endif
/* defines:
@ -158,7 +160,9 @@ static double xnn, znn;
static double powtable[256];
#ifndef CLAMP
#define CLAMP(x,l,u) ((x)<(l)?(l):((x)>(u)?(u):(x)))
#endif
static void

View File

@ -2,6 +2,7 @@
AM_CPPFLAGS = @STRIP_BEGIN@ \
-DG_LOG_DOMAIN=\"Gimp-Core\" \
-DGIMP_COMPILATION \
@GIMP_THREAD_FLAGS@ \
@GIMP_MP_FLAGS@ \
@STRIP_END@

View File

@ -57,12 +57,14 @@ from the Author.
#include <stdlib.h>
#include <math.h>
#ifdef _MSC_VER
/* msvc does not now cbrt() is it nonstandard ? */
#ifndef __GLIBC__
/* cbrt() is a GNU extension */
#define cbrt(x) (pow(x, 1.0/3.0))
#endif
#ifdef GIMP_COMPILATION
#include <glib.h> /* to get working 'inline' */
#endif
/* defines:
@ -158,7 +160,9 @@ static double xnn, znn;
static double powtable[256];
#ifndef CLAMP
#define CLAMP(x,l,u) ((x)<(l)?(l):((x)>(u)?(u):(x)))
#endif
static void

View File

@ -1049,7 +1049,7 @@ gfig_list_load_all (GList *plist)
g_free (filename);
}
g_close_close (dir);
g_dir_close (dir);
}
}

View File

@ -411,21 +411,21 @@ static void plugin_run (gchar *name,
static void plug_in_parse_gflare_path (void);
static GFlare * gflare_new_with_default (gchar *new_name);
static GFlare * gflare_dup (GFlare *src,
gchar *new_name);
static void gflare_copy (GFlare *dest,
GFlare *src);
static GFlare * gflare_load (gchar *filename,
gchar *name);
static void gflare_save (GFlare *gflare);
static void gflare_name_copy (gchar *dest,
gchar *src);
static GFlare * gflare_new_with_default (const gchar *new_name);
static GFlare * gflare_dup (GFlare *src,
const gchar *new_name);
static void gflare_copy (GFlare *dest,
GFlare *src);
static GFlare * gflare_load (const gchar *filename,
const gchar *name);
static void gflare_save (GFlare *gflare);
static void gflare_name_copy (gchar *dest,
const gchar *src);
static gint gflares_list_insert (GFlare *gflare);
static GFlare * gflares_list_lookup (gchar *name);
static gint gflares_list_index (GFlare *gflare);
static gint gflares_list_remove (GFlare *gflare);
static gint gflares_list_insert (GFlare *gflare);
static GFlare * gflares_list_lookup (const gchar *name);
static gint gflares_list_index (GFlare *gflare);
static gint gflares_list_remove (GFlare *gflare);
static void gflares_list_load_all (void);
static void gflares_list_free_all (void);
@ -1341,7 +1341,7 @@ gflare_new ()
}
GFlare *
gflare_new_with_default (gchar *new_name)
gflare_new_with_default (const gchar *new_name)
{
DEBUG_PRINT (("gflare_new_with_default %s\n", new_name));
@ -1349,7 +1349,7 @@ gflare_new_with_default (gchar *new_name)
}
GFlare *
gflare_dup (GFlare *src, gchar *new_name)
gflare_dup (GFlare *src, const gchar *new_name)
{
GFlare *dest;
@ -1395,7 +1395,7 @@ gflare_free (GFlare *gflare)
}
GFlare *
gflare_load (char *filename, char *name)
gflare_load (const gchar *filename, const gchar *name)
{
FILE *fp;
GFlareFile *gf;
@ -1682,7 +1682,7 @@ gflare_write_gradient_name (GradientName name, FILE *fp)
}
void
gflare_name_copy (gchar *dest, gchar *src)
gflare_name_copy (gchar *dest, const gchar *src)
{
strncpy (dest, src, GFLARE_NAME_MAX);
dest[GFLARE_NAME_MAX-1] = '\0';
@ -1728,7 +1728,7 @@ gflares_list_insert (GFlare *gflare)
}
GFlare *
gflares_list_lookup (gchar *name)
gflares_list_lookup (const gchar *name)
{
GList *tmp;
GFlare *gflare;

View File

@ -271,13 +271,13 @@ void readdirintolist_real(char *subdir, GtkWidget *list, char *selected)
}
}
dir = g_dir_open(subdir);
dir = g_dir_open(subdir, 0, NULL);
if(!dir)
return;
for(;;) {
if(!(de = g_dir_read-name(dir))) break;
if(!(de = g_dir_read_name(dir))) break;
fpath = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", subdir, de);
stat(fpath, &st);
g_free(fpath);