fcserialize.c \
fcstat.c \
fcstr.c \
+ fcwindows.h \
fcxml.c \
ftglue.h \
ftglue.c
*
* Copyright © 2007 Chris Wilson
* Copyright © 2009,2010 Red Hat, Inc.
- * Copyright © 2011,2012 Google, Inc.
- *
- * This is part of HarfBuzz, a text shaping library.
+ * Copyright © 2011,2012,2013 Google, Inc.
*
* Permission is hereby granted, without written agreement and without
* license or royalty fees, to use, copy, modify, and distribute this
#elif !defined(FC_NO_MT) && defined(_MSC_VER) || defined(__MINGW32__)
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+#include "fcwindows.h"
/* mingw32 does not have MemoryBarrier.
* MemoryBarrier may be defined as a macro or a function.
}
#endif
-typedef int fc_atomic_int_t;
+typedef LONG fc_atomic_int_t;
#define fc_atomic_int_add(AI, V) InterlockedExchangeAdd (&(AI), (V))
#define fc_atomic_ptr_get(P) (HBMemoryBarrier (), (void *) *(P))
status = use ? MMAP_USE : MMAP_DONT_USE;
else
status = MMAP_CHECK_FS;
- fc_atomic_ptr_cmpexch (&static_status, NULL, (void *) status);
+ (void) fc_atomic_ptr_cmpexch (&static_status, NULL, (void *) status);
}
if (status == MMAP_CHECK_FS)
#include <dirent.h>
#include <sys/types.h>
-#if defined (_WIN32) && (defined (PIC) || defined (DLL_EXPORT))
-#define STRICT
-#include <windows.h>
-#undef STRICT
-#endif
-
#if defined (_WIN32) && !defined (R_OK)
#define R_OK 4
#endif
if (FcRefDec (&config->ref) != 1)
return;
- fc_atomic_ptr_cmpexch (&_fcConfig, config, NULL);
+ (void) fc_atomic_ptr_cmpexch (&_fcConfig, config, NULL);
FcStrSetDestroy (config->configDirs);
FcStrSetDestroy (config->fontDirs);
#if defined (_WIN32)
-# define WIN32_LEAN_AND_MEAN
-# define WIN32_EXTRA_LEAN
-# include <windows.h>
-
static FcChar8 fontconfig_path[1000] = ""; /* MT-dontcare */
# if (defined (PIC) || defined (DLL_EXPORT))
BOOL WINAPI
DllMain (HINSTANCE hinstDLL,
DWORD fdwReason,
+ LPVOID lpvReserved);
+
+BOOL WINAPI
+DllMain (HINSTANCE hinstDLL,
+ DWORD fdwReason,
LPVOID lpvReserved)
{
FcChar8 *p;
#endif
#ifdef _WIN32
-# ifndef _WIN32_WINNT
-# define _WIN32_WINNT 0x0500
-# endif
-# define WIN32_LEAN_AND_MEAN
-# define STRICT
-# include <windows.h>
+# include "fcwindows.h"
typedef UINT (WINAPI *pfnGetSystemWindowsDirectory)(LPSTR, UINT);
typedef HRESULT (WINAPI *pfnSHGetFolderPathA)(HWND, int, HANDLE, DWORD, LPSTR);
extern pfnGetSystemWindowsDirectory pGetSystemWindowsDirectory;
*
* Copyright © 2007 Chris Wilson
* Copyright © 2009,2010 Red Hat, Inc.
- * Copyright © 2011,2012 Google, Inc.
+ * Copyright © 2011,2012,2013 Google, Inc.
*
* Permission is hereby granted, without written agreement and without
* license or royalty fees, to use, copy, modify, and distribute this
#elif !defined(FC_NO_MT) && defined(_MSC_VER) || defined(__MINGW32__)
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+#include "fcwindows.h"
typedef CRITICAL_SECTION fc_mutex_impl_t;
#define FC_MUTEX_IMPL_INIT { NULL, 0, 0, NULL, NULL, 0 }
#define fc_mutex_impl_init(M) InitializeCriticalSection (M)
#endif
#ifdef _WIN32
-
-#include <windows.h>
-
#ifdef __GNUC__
typedef long long INT64;
#define EPOCH_OFFSET 11644473600ll
#ifdef HAVE_REGEX_H
#include <regex.h>
#endif
-#ifdef _WIN32
-#include <windows.h>
-#endif
/* Objects MT-safe for readonly access. */
--- /dev/null
+/*
+ * fontconfig/src/fcwindows.h
+ *
+ * Copyright © 2013 Google, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of the author(s) not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. The authors make no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Google Author(s): Behdad Esfahbod
+ */
+
+#ifndef _FCWINDOWS_H_
+#define _FCWINDOWS_H_
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef _WIN32
+# ifndef _WIN32_WINNT
+# define _WIN32_WINNT 0x0500
+# endif
+# define WIN32_LEAN_AND_MEAN
+# define WIN32_EXTRA_LEAN
+# define STRICT
+# include <windows.h>
+#endif
+
+#endif /* _FCWINDOWS_H_ */
FcParseRange (FcConfigParse *parse)
{
FcVStack *vstack;
- FcRange r;
+ FcRange r = {0, 0};
FcChar32 n;
int count = 1;
#ifdef _WIN32
if (strcmp ((const char *) data, "CUSTOMFONTDIR") == 0)
{
- char *p;
+ FcChar8 *p;
data = buffer;
if (!GetModuleFileName (NULL, (LPCH) buffer, sizeof (buffer) - 20))
{
*/
p = _mbsrchr (data, '\\');
if (p) *p = '\0';
- strcat (data, "\\fonts");
+ strcat ((char *) data, "\\fonts");
}
else if (strcmp ((const char *) data, "APPSHAREFONTDIR") == 0)
{
- char *p;
+ FcChar8 *p;
data = buffer;
if (!GetModuleFileName (NULL, (LPCH) buffer, sizeof (buffer) - 20))
{
}
p = _mbsrchr (data, '\\');
if (p) *p = '\0';
- strcat (data, "\\..\\share\\fonts");
+ strcat ((char *) data, "\\..\\share\\fonts");
}
else if (strcmp ((const char *) data, "WINDOWSFONTDIR") == 0)
{
goto bail;
}
if (data [strlen ((const char *) data) - 1] != '\\')
- strcat (data, "\\");
- strcat (data, "fonts");
+ strcat ((char *) data, "\\");
+ strcat ((char *) data, "fonts");
}
#endif
if (strlen ((char *) data) == 0)
goto bail;
}
if (data [strlen ((const char *) data) - 1] != '\\')
- strcat (data, "\\");
- strcat (data, "fontconfig\\cache");
+ strcat ((char *) data, "\\");
+ strcat ((char *) data, "fontconfig\\cache");
}
else if (strcmp ((const char *) data, "LOCAL_APPDATA_FONTCONFIG_CACHE") == 0)
{