#define TSRM_CONFIG_W32_H
#define HAVE_UTIME 1
+#define HAVE_ALLOCA 1
+
+#undef inline
+#ifdef ZEND_WIN32_FORCE_INLINE
+# define inline __forceinline
+#else
+# define inline
+#endif
+
#endif
--- /dev/null
+#ifndef TSRM_CONFIG_COMMON_H
+#define TSRM_CONFIG_COMMON_H
+
+#if WINNT|WIN32
+# define TSRM_WIN32
+#endif
+
+#ifndef TSRM_WIN32
+# include "tsrm_config.h"
+#else
+# include "tsrm_config.w32.h"
+#endif
+
+#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2))
+# define tsrm_do_alloca(p) alloca(p)
+# define tsrm_free_alloca(p)
+#else
+# define tsrm_do_alloca(p) malloc(p)
+# define tsrm_free_alloca(p) free(p)
+#endif
+
+#endif /* TSRM_CONFIG_COMMON_H */
-#include "tsrm_strtok_r.h"
-
#include <stdio.h>
-static int in_character_class(char ch, const char *delim)
+#include "tsrm_config_common.h"
+#include "tsrm_strtok_r.h"
+
+static inline int in_character_class(char ch, const char *delim)
{
while (*delim) {
if (*delim == ch) {
#define MAXPATHLEN 256
#endif
-#ifndef do_alloca
-# if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(TSRM_WIN32))
-# define do_alloca(p) alloca(p)
-# define free_alloca(p)
-# else
-# define do_alloca(p) malloc(p)
-# define free_alloca(p) free(p)
-# endif
-#endif
-
#ifdef TSRM_WIN32
#include <io.h>
#endif
if (length == COPY_WHEN_ABSOLUTE && IS_ABSOLUTE_PATH(path, length+1)) { /* Also use trailing slash if this is absolute */
length++;
}
- temp = (char *) do_alloca(length+1);
+ temp = (char *) tsrm_do_alloca(length+1);
memcpy(temp, path, length);
temp[length] = 0;
#if VIRTUAL_CWD_DEBUG
fprintf (stderr, "Changing directory to %s\n", temp);
#endif
retval = p_chdir(temp);
- free_alloca(temp);
+ tsrm_free_alloca(temp);
return retval;
}
#ifndef VIRTUAL_CWD_H
#define VIRTUAL_CWD_H
-#ifdef WIN32
-# define TSRM_WIN32
-#endif
-
-#ifndef TSRM_WIN32
-# include "tsrm_config.h"
-#else
-# include "tsrm_config.w32.h"
-#endif
+#include "tsrm_config_common.h"
#include <sys/types.h>
#include <sys/stat.h>