You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by hi...@apache.org on 2007/05/01 13:04:22 UTC
svn commit: r534006 - in /harmony/enhanced/classlib/trunk/modules:
luni/src/main/native/launcher/shared/libhlp.c
luni/src/main/native/launcher/shared/main.c
portlib/src/main/native/include/shared/hycomp.h
Author: hindessm
Date: Tue May 1 04:04:21 2007
New Revision: 534006
URL: http://svn.apache.org/viewvc?view=rev&rev=534006
Log:
Refactor PATH_SEPARATOR and LIBPATH_ENV_VAR to hycomp.h.
Modified:
harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/libhlp.c
harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c
harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hycomp.h
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/libhlp.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/libhlp.c?view=diff&rev=534006&r1=534005&r2=534006
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/libhlp.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/libhlp.c Tue May 1 04:04:21 2007
@@ -171,12 +171,6 @@
HyStringBuffer ** finalJavaLibraryPath,
char *argv0)
{
-#if defined(WIN32)
-#define ENV_PATH "PATH"
-#else
-#define ENV_PATH "LD_LIBRARY_PATH"
-#endif
-
HyStringBuffer *javaLibraryPath = NULL;
char *exeName = NULL;
IDATA rc = -1;
@@ -206,7 +200,7 @@
exeName = NULL;
}
- envSize = hysysinfo_get_env (ENV_PATH, NULL, 0);
+ envSize = hysysinfo_get_env (LIBPATH_ENV_VAR, NULL, 0);
if (envSize > 0)
{
if (envSize >= ENV_BUFFER_SIZE)
@@ -214,12 +208,12 @@
envResult = hymem_allocate_memory (envSize + 1);
if (!envResult)
goto done;
- hysysinfo_get_env (ENV_PATH, envResult, envSize);
+ hysysinfo_get_env (LIBPATH_ENV_VAR, envResult, envSize);
}
else
{
envSize = -1; /* make it -1 so we don't free the buffer */
- hysysinfo_get_env (ENV_PATH, envBuffer, ENV_BUFFER_SIZE);
+ hysysinfo_get_env (LIBPATH_ENV_VAR, envBuffer, ENV_BUFFER_SIZE);
envResult = envBuffer;
}
}
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c?view=diff&rev=534006&r1=534005&r2=534006
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c Tue May 1 04:04:21 2007
@@ -1058,13 +1058,8 @@
main_get_executable_name (argv[0], &exeName);
#endif /* HY_NO_THR */
-#if defined(WIN32)
- variableName = "PATH";
- separator = ";";
-#else
- variableName = "LD_LIBRARY_PATH";
- separator = ":";
-#endif
+ variableName = LIBPATH_ENV_VAR;
+ separator = PATH_SEPARATOR_STR;
oldPath = getenv (variableName);
if (!oldPath) {
Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hycomp.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hycomp.h?view=diff&rev=534006&r1=534005&r2=534006
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hycomp.h (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hycomp.h Tue May 1 04:04:21 2007
@@ -127,6 +127,13 @@
#define PLATFORM_LINE_DELIMITER "\012"
#define DIR_SEPARATOR '/'
#define DIR_SEPARATOR_STR "/"
+#define PATH_SEPARATOR ':'
+#define PATH_SEPARATOR_STR ":"
+#if defined(AIX)
+#define LIBPATH_ENV_VAR "LIBPATH"
+#else
+#define LIBPATH_ENV_VAR "LD_LIBRARY_PATH"
+#endif
/**
* No priorities on Linux
@@ -155,6 +162,9 @@
#define DIR_SEPARATOR '\\'
#define DIR_SEPARATOR_STR "\\"
+#define PATH_SEPARATOR ';'
+#define PATH_SEPARATOR_STR ";"
+#define LIBPATH_ENV_VAR "PATH"
/* Modifications for the Alpha running WIN-NT */
#if defined(_ALPHA_)