+2008-09-13 Tor Lillqvist <tml@novell.com>
+
+ * glib/gutils.h
+ * glib/gwin32.h: Deprecate G_WIN32_DLLMAIN_FOR_DLL_NAME(),
+ g_win32_get_package_installation_directory() and
+ g_win32_get_package_installation_subdirectory() as their
+ documentation has warned for a while. Sorry that I forgot to do
+ this before 2.18.0.
+
+ * glib/gwin32.c (g_win32_get_package_installation_directory):
+ Print a warning if a non-NULL package parameter is passed to this
+ function, as that is deprecated usage, as the documentation says.
+
2008-09-11 Matthias Clasen <mclasen@redhat.com>
Bug 548321 – <string.h> is not included in gi18n-lib.h
G_END_DECLS
+#ifndef G_DISABLE_DEPRECATED
+
/*
- * This macro will be deprecated in the future. This DllMain() is too
- * complex. It is recommended to have a DLlMain() that just saves the
- * handle to the DLL and then use that handle in normal code instead,
- * for instance passing it to
+ * This macro is deprecated. This DllMain() is too complex. It is
+ * recommended to write an explicit minimal DLlMain() that just saves
+ * the handle to the DLL and then use that handle instead, for
+ * instance passing it to
* g_win32_get_package_installation_directory_of_module().
*
* On Windows, this macro defines a DllMain function that stores the
\
return TRUE; \
}
+
+#endif /* !G_DISABLE_DEPRECATED */
+
#endif /* G_PLATFORM_WIN32 */
#endif /* __G_UTILS_H__ */
*
* Try to determine the installation directory for a software package.
*
- * This function will be deprecated in the future. Use
+ * This function is deprecated. Use
* g_win32_get_package_installation_directory_of_module() instead.
*
- * The use of @package is deprecated. You should always pass %NULL.
+ * The use of @package is deprecated. You should always pass %NULL. A
+ * warning is printed if non-NULL is passed as @package.
*
* The original intended use of @package was for a short identifier of
* the package, typically the same identifier as used for
*
* For this reason it is recommeded to always pass %NULL as
* @package to this function, to avoid the temptation to use the
- * Registry. In version 2.18 of GLib the @package parameter
+ * Registry. In version 2.20 of GLib the @package parameter
* will be ignored and this function won't look in the Registry at all.
*
* If @package is %NULL, or the above value isn't found in the
* @package. The string is in the GLib file name encoding,
* i.e. UTF-8. The return value should be freed with g_free() when not
* needed any longer. If the function fails %NULL is returned.
+ *
+ * @Deprecated:2.18: Pass the HMODULE of a DLL or EXE to
+ * g_win32_get_package_installation_directory_of_module() instead.
**/
-gchar *
-g_win32_get_package_installation_directory (const gchar *package,
- const gchar *dll_name)
+ gchar *
+g_win32_get_package_installation_directory_utf8 (const gchar *package,
+ const gchar *dll_name)
{
static GHashTable *package_dirs = NULL;
G_LOCK_DEFINE_STATIC (package_dirs);
DWORD type;
DWORD nbytes;
+#if GLIB_CHECK_VERSION (2, 19, 0)
+ if (package != NULL)
+ g_warning ("Passing a non-NULL package to g_win32_get_package_installation_directory() is deprecated and it is ignored.");
+#else
if (package != NULL)
{
+ g_warning ("Passing a non-NULL package to g_win32_get_package_installation_directory() is deprecated and will not work in GLib after 2.18.");
+
G_LOCK (package_dirs);
if (package_dirs == NULL)
}
G_UNLOCK (package_dirs);
}
-
+#endif
if (dll_name != NULL)
result = get_package_directory_from_module (dll_name);
#if !defined (_WIN64)
-#undef g_win32_get_package_installation_directory
-
/* DLL ABI binary compatibility version that uses system codepage file names */
gchar *
* @dll_name: The name of a DLL that a package provides, in UTF-8, or %NULL.
* @subdir: A subdirectory of the package installation directory, also in UTF-8
*
- * This function will be deprecated in the future. Use
- * g_win32_get_package_installation_directory_of_module() instead.
+ * This function is deprecated. Use
+ * g_win32_get_package_installation_directory_of_module() and
+ * g_build_filename() instead.
*
* Returns a newly-allocated string containing the path of the
* subdirectory @subdir in the return value from calling
* the GLib file name encoding, i.e. UTF-8. The return value should be
* freed with g_free() when no longer needed. If something goes wrong,
* %NULL is returned.
+ *
+ * @Deprecated:2.18: Pass the HMODULE of a DLL or EXE to
+ * g_win32_get_package_installation_directory_of_module() instead, and
+ * then construct a subdirectory pathname with g_build_filename().
**/
gchar *
-g_win32_get_package_installation_subdirectory (const gchar *package,
- const gchar *dll_name,
- const gchar *subdir)
+g_win32_get_package_installation_subdirectory_utf8 (const gchar *package,
+ const gchar *dll_name,
+ const gchar *subdir)
{
gchar *prefix;
gchar *dirname;
#if !defined (_WIN64)
-#undef g_win32_get_package_installation_subdirectory
-
/* DLL ABI binary compatibility version that uses system codepage file names */
gchar *