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> 2001-02-17 Hans Breuer <hans@breuer.org>
* */*/makefile.msc */makefile.msc : from now on use * */*/makefile.msc */makefile.msc : from now on use

View File

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

View File

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

View File

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

View File

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

View File

@ -411,19 +411,19 @@ static void plugin_run (gchar *name,
static void plug_in_parse_gflare_path (void); static void plug_in_parse_gflare_path (void);
static GFlare * gflare_new_with_default (gchar *new_name); static GFlare * gflare_new_with_default (const gchar *new_name);
static GFlare * gflare_dup (GFlare *src, static GFlare * gflare_dup (GFlare *src,
gchar *new_name); const gchar *new_name);
static void gflare_copy (GFlare *dest, static void gflare_copy (GFlare *dest,
GFlare *src); GFlare *src);
static GFlare * gflare_load (gchar *filename, static GFlare * gflare_load (const gchar *filename,
gchar *name); const gchar *name);
static void gflare_save (GFlare *gflare); static void gflare_save (GFlare *gflare);
static void gflare_name_copy (gchar *dest, static void gflare_name_copy (gchar *dest,
gchar *src); const gchar *src);
static gint gflares_list_insert (GFlare *gflare); static gint gflares_list_insert (GFlare *gflare);
static GFlare * gflares_list_lookup (gchar *name); static GFlare * gflares_list_lookup (const gchar *name);
static gint gflares_list_index (GFlare *gflare); static gint gflares_list_index (GFlare *gflare);
static gint gflares_list_remove (GFlare *gflare); static gint gflares_list_remove (GFlare *gflare);
static void gflares_list_load_all (void); static void gflares_list_load_all (void);
@ -1341,7 +1341,7 @@ gflare_new ()
} }
GFlare * 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)); DEBUG_PRINT (("gflare_new_with_default %s\n", new_name));
@ -1349,7 +1349,7 @@ gflare_new_with_default (gchar *new_name)
} }
GFlare * GFlare *
gflare_dup (GFlare *src, gchar *new_name) gflare_dup (GFlare *src, const gchar *new_name)
{ {
GFlare *dest; GFlare *dest;
@ -1395,7 +1395,7 @@ gflare_free (GFlare *gflare)
} }
GFlare * GFlare *
gflare_load (char *filename, char *name) gflare_load (const gchar *filename, const gchar *name)
{ {
FILE *fp; FILE *fp;
GFlareFile *gf; GFlareFile *gf;
@ -1682,7 +1682,7 @@ gflare_write_gradient_name (GradientName name, FILE *fp)
} }
void void
gflare_name_copy (gchar *dest, gchar *src) gflare_name_copy (gchar *dest, const gchar *src)
{ {
strncpy (dest, src, GFLARE_NAME_MAX); strncpy (dest, src, GFLARE_NAME_MAX);
dest[GFLARE_NAME_MAX-1] = '\0'; dest[GFLARE_NAME_MAX-1] = '\0';
@ -1728,7 +1728,7 @@ gflares_list_insert (GFlare *gflare)
} }
GFlare * GFlare *
gflares_list_lookup (gchar *name) gflares_list_lookup (const gchar *name)
{ {
GList *tmp; GList *tmp;
GFlare *gflare; 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) if(!dir)
return; return;
for(;;) { 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); fpath = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", subdir, de);
stat(fpath, &st); stat(fpath, &st);
g_free(fpath); g_free(fpath);