OSDN Git Service

* environ.cc (getwinenv): Make __stdcall.
authorcgf <cgf>
Mon, 21 Feb 2000 03:13:24 +0000 (03:13 +0000)
committercgf <cgf>
Mon, 21 Feb 2000 03:13:24 +0000 (03:13 +0000)
(winenv): Ditto.
* malloc.cc (strdup): New function.  Occludes newlib version.
(_strdup_r): Ditto.
* winsup.h: Reflect above __stdcall changes.

winsup/cygwin/ChangeLog
winsup/cygwin/environ.cc
winsup/cygwin/malloc_wrapper.cc
winsup/cygwin/winsup.h

index 63a3856..2054f79 100644 (file)
@@ -1,7 +1,19 @@
-Sun Feb 18 21:31:00 2000  Corinna Vinschen <corinna@vinschen.de>
+Sun Feb 20 22:10:21 2000  Christopher Faylor <cgf@cygnus.com>
 
-        * fhandler.cc (fhandler_disk_file::fstat): Modify get_file_attribute
-        return value if FILE_ATTRIBUTE_READONLY is set.
+       * environ.cc (getwinenv): Make __stdcall.
+       (winenv): Ditto.
+       * malloc.cc (strdup): New function.  Occludes newlib version.
+       (_strdup_r): Ditto.
+       * winsup.h: Reflect above __stdcall changes.
+
+Sun Feb 20 21:31:00 2000  Corinna Vinschen <corinna@vinschen.de>
+
+       * fhandler.cc (fhandler_disk_file::fstat): Modify get_file_attribute
+       return value if FILE_ATTRIBUTE_READONLY is set.
+
+Thu Feb 17 11:00:23 2000  Christopher Faylor <cgf@cygnus.com>
+
+       * environ.cc (environ_init): Cosmetic change.
 
 Mon Feb  7 16:50:44 2000  Christopher Faylor <cgf@cygnus.com>
 
index 249e95c..e59802c 100644 (file)
@@ -72,7 +72,7 @@ win_env::add_cache (const char *in_posix, const char *in_native)
  * of the name including a mandatory '='.  Returns a pointer to the
  * appropriate conversion structure.
  */
-win_env *
+win_env * __stdcall
 getwinenv (const char *env, const char *in_posix)
 {
   for (int i = 0; conv_envvars[i].name != NULL; i++)
@@ -153,8 +153,7 @@ my_findenv (const char *name, int *offset)
  *     Returns ptr to value associated with name, if any, else NULL.
  */
 
-extern "C"
-char *
+extern "C" char *
 getenv (const char *name)
 {
   int offset;
@@ -166,8 +165,7 @@ getenv (const char *name)
  *     Sets an environment variable
  */
 
-extern "C"
-int
+extern "C" int
 putenv (const char *str)
 {
   register char *p, *equal;
@@ -192,8 +190,7 @@ putenv (const char *str)
  *     "value".  If rewrite is set, replace any current value.
  */
 
-extern "C"
-int
+extern "C" int
 setenv (const char *name, const char *value, int rewrite)
 {
   register char *C;
@@ -249,8 +246,7 @@ setenv (const char *name, const char *value, int rewrite)
  *     Delete environment variable "name".
  */
 
-extern "C"
-void
+extern "C" void
 unsetenv (const char *name)
 {
   register char **P;
@@ -490,7 +486,7 @@ environ_init (void)
   if (!sawTERM)
     envp[i++] = strdup ("TERM=cygwin");
   envp[i] = NULL;
-  __cygwin_environ = *user_data->envptr = envp;
+  __cygwin_environ = environ = envp;
   FreeEnvironmentStringsA ((char *) rawenv);
   parse_options (NULL);
   MALLOC_CHECK;
@@ -512,7 +508,7 @@ env_sort (const void *a, const void *b)
  * Converts environment variables noted in conv_envvars into win32 form
  * prior to placing them in the string.
  */
-char *
+char * __stdcall
 winenv (const char * const *envp)
 {
   int len, n, tl;
index aa4891b..b4babd9 100644 (file)
@@ -74,7 +74,7 @@ _realloc_r (struct _reent *, void *p, size_t size)
 extern "C" char *
 strdup_dbg (const char *s, const char *file, int line)
 {
-  char    *p;
+  char *p;
   export_malloc_called = 1;
   if ((p = (char *) malloc_dbg (strlen (s) + 1, file, line)) != NULL)
       strcpy (p, s);
@@ -177,6 +177,22 @@ export_calloc (size_t nmemb, size_t size)
   return res;
 }
 
+extern "C" char *
+strdup (const char *s)
+{
+  char *p;
+  size_t len = strlen (s) + 1;
+  if ((p = (char *) malloc (len)) != NULL)
+      memcpy (p, s, len);
+  return p;
+}
+
+extern "C" char *
+_strdup_r (struct _reent *, const char *s)
+{
+  return strdup (s);
+}
+
 /* We use a critical section to lock access to the malloc data
    structures.  This permits malloc to be called from different
    threads.  Note that it does not make malloc reentrant, and it does
index 7b486d0..4bbf789 100644 (file)
@@ -557,9 +557,9 @@ struct win_env
     const char * get_native () {return native ? native + namelen : NULL;}
   };
 
-win_env *getwinenv (const char *name, const char *posix = NULL);
+win_env * __stdcall getwinenv (const char *name, const char *posix = NULL);
 
-char *winenv (const char * const *);
+char * __stdcall winenv (const char * const *);
 extern char **__cygwin_environ;
 
 /* The title on program start. */