Commit 4c7289a5 authored by Hans Breuer's avatar Hans Breuer Committed by Hans Breuer

an ugly but working variant for no varargs macros

2007-12-09  Hans Breuer  <hans@breuer.org>

	* app/gimp-log.h : an ugly but working variant for no varargs macros
	
	* app/base/base-utils.c(get_physical_memory_size) : fallback to
	GetMemoryStatus() for older compiler/sdk
	
	* app/core/gimplayer-floating-sel.c : second argument to g_set_error()
	is an uint32, not a pointer


svn path=/trunk/; revision=24306
parent 6f5bbfe0
2007-12-09 Hans Breuer <hans@breuer.org>
* app/gimp-log.h : an ugly but working variant for no varargs macros
* app/base/base-utils.c(get_physical_memory_size) : fallback to
GetMemoryStatus() for older compiler/sdk
* app/core/gimplayer-floating-sel.c : second argument to g_set_error()
is an uint32, not a pointer
* **/makefile.msc : updated and removed -GD to let msvc9 complain less
2007-12-09 Martin Nordholts <martinn@svn.gnome.org>
......
......@@ -66,12 +66,21 @@ get_physical_memory_size (void)
#endif
#ifdef G_OS_WIN32
# if defined(_MSC_VER) && (_MSC_VER <= 1200)
MEMORYSTATUS memory_status;
memory_status.dwLength = sizeof (memory_status);
GlobalMemoryStatus (&memory_status);
return memory_status.dwTotalPhys;
# else
/* requires w2k and newer SDK than provided with msvc6 */
MEMORYSTATUSEX memory_status;
memory_status.dwLength = sizeof (memory_status);
if (GlobalMemoryStatusEx (&memory_status))
return memory_status.ullTotalPhys;
# endif
#endif
return 0;
......
......@@ -200,10 +200,10 @@ floating_sel_to_layer (GimpLayer *layer,
/* Check if the floating layer belongs to a channel... */
if (GIMP_IS_CHANNEL (layer->fs.drawable))
{
g_set_error (error, NULL, 0,
g_set_error (error, 0, 0,
_("Cannot create a new layer from the floating selection "
"because it belongs to a layer mask or channel."));
return;
return FALSE;
}
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_FS_TO_LAYER,
......
......@@ -32,6 +32,22 @@ typedef enum
} GimpLogFlags;
extern GimpLogFlags gimp_log_flags;
void gimp_log_init (void);
void gimp_log (const gchar *function,
gint line,
const gchar *domain,
const gchar *format,
...) G_GNUC_PRINTF (4, 5);
void gimp_logv (const gchar *function,
gint line,
const gchar *domain,
const gchar *format,
va_list args);
#ifdef G_HAVE_ISO_VARARGS
#define GIMP_LOG(type, ...) \
......@@ -50,36 +66,30 @@ typedef enum
#else /* no varargs macros */
/* need to expand all the short forms to make them known constants at compile time */
#define TOOL_EVENTS GIMP_LOG_TOOL_EVENTS
#define TOOL_FOCUS GIMP_LOG_TOOL_FOCUS
#define DND GIMP_LOG_DND
#define HELP GIMP_LOG_HELP
#define DIALOG_FACTORY GIMP_LOG_DIALOG_FACTORY
#define SAVE_DIALOG GIMP_LOG_SAVE_DIALOG
#define IMAGE_SCALE GIMP_LOG_IMAGE_SCALE
#if 0 /* last resort */
# define GIMP_LOG /* nothing => no varargs, no log */
#endif
static void
GIMP_LOG (const gchar *function,
gint line,
const gchar *domain,
GIMP_LOG (GimpLogFlags flags,
const gchar *format,
...)
{
va_list args;
va_start (args, format);
gimp_logv (function, line, domain, format, args);
if (gimp_log_flags & flags)
gimp_logv ("", 0, "", format, args);
va_end (args);
}
#endif /* !__GNUC__ */
extern GimpLogFlags gimp_log_flags;
void gimp_log_init (void);
void gimp_log (const gchar *function,
gint line,
const gchar *domain,
const gchar *format,
...) G_GNUC_PRINTF (4, 5);
void gimp_logv (const gchar *function,
gint line,
const gchar *domain,
const gchar *format,
va_list args);
#endif /* __GIMP_LOG_H__ */
......@@ -24,8 +24,6 @@ EXPORTS
colorize_calculate
colorize_init
convolve_region
curves_calculate_curve
curves_channel_reset
curves_init
curves_lut_func
file_open_image
......@@ -914,3 +912,18 @@ gimp_image_parasite_detach
gimp_image_get_active_drawable
gimp_image_get_load_proc
gimp_log
gimp_logv
gimp_log_flags
gimp_log_init
gimp_viewable_preview_is_frozen
gimp_curve_new
gimp_curve_get_type
gimp_curve_reset
gimp_curve_set_point
gimp_curve_get_uchar
gimp_curve_move_point
gimp_curve_set_curve
gimp_curve_set_curve_type
gimp_curve_get_closest_point
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