diff --git a/ChangeLog b/ChangeLog index ed7e6ef23..3b33d96c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-01-17 Tor Lillqvist + + * config.h.win32.in + * glib/galloca.h + * glib/gbacktrace.h + * glib/gwin32.c + * glibconfig.h.win32.in + * README.win32: More minor tweaks for Digital Mars + compiler. (#346808, Serhat Sevki Dincer) + 2007-01-17 Tor Lillqvist * makefile.mingw diff --git a/README.win32 b/README.win32 index d77c417c8..8ad9a3f8d 100644 --- a/README.win32 +++ b/README.win32 @@ -49,6 +49,7 @@ available in all source files that include or GTK+ headers. Additionally, there are the compiler-specific macros: - __GNUC__ is defined when using gcc - _MSC_VER is defined when using the Microsoft compiler +- __DMC__ is defined when using the Digital Mars C/C++ compiler G_OS_WIN32 implies using the Microsoft C runtime MSVCRT.DLL. GLib is not known to work with the older CRTDLL.DLL runtime, or the static diff --git a/config.h.win32.in b/config.h.win32.in index c6db93305..79dc2dcba 100644 --- a/config.h.win32.in +++ b/config.h.win32.in @@ -83,11 +83,11 @@ #define G_HAVE___INLINE 1 /* Have __inline__ keyword */ -#ifndef _MSC_VER +#if !defined(_MSC_VER) && !defined(__DMC__) #define G_HAVE___INLINE__ 1 -#else /* _MSC_VER */ +#else /* _MSC_VER or __DMC__ */ /* #undef G_HAVE___INLINE__ */ -#endif /* _MSC_VER */ +#endif /* _MSC_VER or __DMC__ */ /* Source file containing theread implementation */ #define G_THREAD_SOURCE "gthread-win32.c" @@ -263,6 +263,9 @@ /* Define to 1 if you have the `snprintf' function. */ #ifndef _MSC_VER #define HAVE_SNPRINTF 1 +#ifdef __DMC__ +#define snprintf _snprintf +#endif #else /* _MSC_VER */ /* #undef HAVE_SNPRINTF */ #endif /* _MSC_VER */ @@ -292,21 +295,21 @@ /* #undef HAVE_STPCPY */ /* Define to 1 if you have the `strcasecmp' function. */ -#ifndef _MSC_VER +#if !defined(_MSC_VER) && !defined(__DMC__) #define HAVE_STRCASECMP 1 -#else /* _MSC_VER */ +#else /* _MSC_VER or __DMC__ */ /* #undef HAVE_STRCASECMP */ -#endif /* _MSC_VER */ +#endif /* _MSC_VER or __DMC__ */ /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1 /* Define to 1 if you have the header file. */ -#ifndef _MSC_VER +#if !defined(_MSC_VER) && !defined(__DMC__) #define HAVE_STRINGS_H 1 -#else /* _MSC_VER */ +#else /* _MSC_VER or __DMC__ */ /* #undef HAVE_STRINGS_H */ -#endif /* _MSC_VER */ +#endif /* _MSC_VER or __DMC__ */ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 @@ -315,11 +318,11 @@ /* #undef HAVE_STRLCPY */ /* Define to 1 if you have the `strncasecmp' function. */ -#ifndef _MSC_VER +#if !defined(_MSC_VER) && !defined(__DMC__) #define HAVE_STRNCASECMP 1 -#else /* _MSC_VER */ +#else /* _MSC_VER or __DMC__ */ /* #undef HAVE_STRNCASECMP */ -#endif /* _MSC_VER */ +#endif /* _MSC_VER or __DMC__ */ /* Define to 1 if you have the `strsignal' function. */ /* #undef HAVE_STRSIGNAL */ @@ -328,11 +331,11 @@ /* #undef HAVE_SYMLINK */ /* Define to 1 if you have the header file. */ -#ifndef _MSC_VER +#if !defined(_MSC_VER) && !defined(__DMC__) #define HAVE_SYS_PARAM_H 1 -#else /* _MSC_VER */ +#else /* _MSC_VER or __DMC__ */ /* #undef HAVE_SYS_PARAM_H */ -#endif /* _MSC_VER */ +#endif /* _MSC_VER or __DMC__ */ /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_POLL_H */ @@ -371,11 +374,11 @@ /* #undef HAVE_UNSETENV */ /* Define to 1 if you have the header file. */ -#ifndef _MSC_VER +#if !defined(_MSC_VER) && !defined(__DMC__) #define HAVE_VALUES_H 1 -#else /* _MSC_VER */ +#else /* _MSC_VER or __DMC__ */ /* #undef HAVE_VALUES_H */ -#endif /* _MSC_VER */ +#endif /* _MSC_VER or __DMC__ */ /* Define to 1 if you have the `vasprintf' function. */ #define HAVE_VASPRINTF 1 @@ -386,6 +389,9 @@ /* Define to 1 if you have the `vsnprintf' function. */ #ifndef _MSC_VER #define HAVE_VSNPRINTF 1 +#ifdef __DMC__ +#define vsnprintf _vsnprintf +#endif #else /* _MSC_VER */ /* #undef HAVE_VSNPRINTF */ #endif /* _MSC_VER */ diff --git a/glib/galloca.h b/glib/galloca.h index 7c59ea45d..baf80096a 100644 --- a/glib/galloca.h +++ b/glib/galloca.h @@ -40,7 +40,7 @@ # if defined(_MSC_VER) || defined(__DMC__) # include # define alloca _alloca -# else /* !_MSC_VER */ +# else /* !_MSC_VER && !__DMC__ */ # ifdef _AIX # pragma alloca # else /* !_AIX */ @@ -50,7 +50,7 @@ char *alloca (); G_END_DECLS # endif /* !alloca */ # endif /* !_AIX */ -# endif /* !_MSC_VER */ +# endif /* !_MSC_VER && !__DMC__ */ #endif /* !__GNUC__ && !GLIB_HAVE_ALLOCA_H */ #define g_alloca(size) alloca (size) diff --git a/glib/gbacktrace.h b/glib/gbacktrace.h index 0c9981a3f..836264ea5 100644 --- a/glib/gbacktrace.h +++ b/glib/gbacktrace.h @@ -48,7 +48,7 @@ void g_on_error_stack_trace (const gchar *prg_name); */ #if (defined (__i386__) || defined (__x86_64__)) && defined (__GNUC__) && __GNUC__ >= 2 # define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("int $03"); }G_STMT_END -#elif defined (_MSC_VER) && defined (_M_IX86) +#elif (defined (_MSC_VER) || defined (__DMC__)) && defined (_M_IX86) # define G_BREAKPOINT() G_STMT_START{ __asm int 3h }G_STMT_END #elif defined (__alpha__) && !defined(__osf__) && defined (__GNUC__) && __GNUC__ >= 2 # define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("bpt"); }G_STMT_END diff --git a/glib/gwin32.c b/glib/gwin32.c index 6d009a660..4589557ca 100644 --- a/glib/gwin32.c +++ b/glib/gwin32.c @@ -47,9 +47,9 @@ #endif #include #include -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__DMC__) # include -#endif /* _MSC_VER */ +#endif /* _MSC_VER || __DMC__ */ #include "glib.h" #include "galias.h" diff --git a/glibconfig.h.win32.in b/glibconfig.h.win32.in index 315249ad8..7aaf65517 100644 --- a/glibconfig.h.win32.in +++ b/glibconfig.h.win32.in @@ -108,26 +108,17 @@ typedef unsigned int gsize; #define G_HAVE_INLINE 1 #endif /* _MSC_VER */ #define G_HAVE___INLINE 1 -#ifndef _MSC_VER +#if !defined(_MSC_VER) && !defined(__DMC__) #define G_HAVE___INLINE__ 1 -#endif /* not _MSC_VER */ +#endif /* !_MSC_VER and !__DMC__ */ #endif /* !__cplusplus */ -#ifdef __cplusplus +#if defined(__cplusplus) || !defined(_MSC_VER) #define G_CAN_INLINE 1 -#else /* !__cplusplus */ -#ifndef _MSC_VER -#define G_CAN_INLINE 1 -#endif #endif #ifndef _MSC_VER -#ifndef __cplusplus -# define G_HAVE_ISO_VARARGS 1 -#endif -#ifdef __cplusplus -# define G_HAVE_ISO_VARARGS 1 -#endif +#define G_HAVE_ISO_VARARGS 1 /* gcc-2.95.x supports both gnu style and ISO varargs, but if -ansi * is passed ISO vararg support is turned off, and there is no work