Re: [hatari-devel] OSx problems

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Jerome,

Could you upload the updated paths.c file to Dropbox? That would be safer than trying to make the changes manually. I was able to compile and use the source code that you uploaded earlier. It was nice to use the most recent Hatari code without waiting for the OS X interface to crash.

Thomas,

I know that you want patch files in order to commit the changes. Since Jerome is busy, could you give me information on how to create the appropriate patch files?

Cocoa Pod,

Do you have any later changes than what Jerome uploaded to Dropbox? If you have made additional changes, they should probably be included as well.


Bob C

On May 31, 2014, at 5:07 PM, Jerome Vernet <vernet.jerome@xxxxxxxxxx> wrote:

> There is also some changes in path.c
> 
> diff -r f7dcf5df7170 src/paths.c
> --- a/src/paths.c    Sat May 31 20:09:07 2014 +0200
> +++ b/src/paths.c    Sun Jun 01 00:05:13 2014 +0200
> @@ -20,10 +20,16 @@
> #define mkdir(name,mode) mkdir(name)
> #endif  /* WIN32 */
> 
> -static char sWorkingDir[FILENAME_MAX];    /* Working directory */
> -static char sDataDir[FILENAME_MAX];       /* Directory where data files of Hatari can be found */
> -static char sUserHomeDir[FILENAME_MAX];   /* User's home directory ($HOME) */
> -static char sHatariHomeDir[FILENAME_MAX]; /* Hatari's home directory ($HOME/.hatari/) */
> +#if defined(__MACOSX__)
> +    #define dirSave "Library/Application Support/Hatari"
> +#else
> +    #define dirSave ".hatari"
> +#endif
> +
> +static char sWorkingDir[FILENAME_MAX];    // Working directory
> +static char sDataDir[FILENAME_MAX];       // Directory where data files of Hatari can be found
> +static char sUserHomeDir[FILENAME_MAX];   // User's home directory ($HOME)
> +static char sHatariHomeDir[FILENAME_MAX]; // Hatari's home directory ($HOME/.hatari/)
> 
> 
> /**
> @@ -93,8 +99,8 @@
>     pAct = strtok (pPathEnv, pToken);
>     while (pAct)
>     {
> -        snprintf(pTmpName, FILENAME_MAX, "%s%c%s",
> -                 pAct, PATHSEP, argv0);
> +        snprintf(pTmpName, FILENAME_MAX, "%s%c%s", pAct, PATHSEP, argv0);
> +
>         if (File_Exists(pTmpName))
>         {
>             /* Found the executable - so use the corresponding path: */
> @@ -214,8 +220,7 @@
>         sUserHomeDir[FILENAME_MAX-1] = 0;
> 
>         /* Try to use a .hatari directory in the users home directory */
> -        snprintf(sHatariHomeDir, FILENAME_MAX, "%s%c.hatari",
> -                 sUserHomeDir, PATHSEP);
> +        snprintf(sHatariHomeDir, FILENAME_MAX, "%s%c%s", sUserHomeDir, PATHSEP, dirSave);
>         if (!File_DirExists(sHatariHomeDir))
>         {
>             /* Hatari home directory does not exists yet...
> @@ -240,38 +245,26 @@
>  */
> void Paths_Init(const char *argv0)
> {
> -    char *psExecDir;  /* Path string where the hatari executable can be found */
> +char *psExecDir;                                            // Path string where the hatari executable can be found
> +
> +    if (getcwd(sWorkingDir, FILENAME_MAX) == NULL)            // Init working directory string
> +        strcpy(sWorkingDir, ".") ;                            // This should never happen... just in case...
> 
> -    /* Init working directory string */
> -    if (getcwd(sWorkingDir, FILENAME_MAX) == NULL)
> -    {
> -        /* This should never happen... just in case... */
> -        strcpy(sWorkingDir, ".");
> -    }
> +    Paths_InitHomeDirs();                                    // Init the user's home directory string
> +    psExecDir = Paths_InitExecDir(argv0);                    // Get the directory where the executable resides
> +
> +    if (psExecDir && strlen(psExecDir) > 0)         // Now create the datadir path name from the bindir path name
> +     {
> +        snprintf(sDataDir, sizeof(sDataDir), "%s%c%s", psExecDir, PATHSEP, BIN2DATADIR);
> +     }
> +    else
> +     {                                                        // bindir could not be determined, let's assume datadir
> +        strcpy(sDataDir, BIN2DATADIR);                        // is relative to current working directory...
> +     } ;
> 
> -    /* Init the user's home directory string */
> -    Paths_InitHomeDirs();
> +    File_MakeAbsoluteName(sDataDir);                        // And finally make a proper absolute path out of datadir
> 
> -    /* Get the directory where the executable resides */
> -    psExecDir = Paths_InitExecDir(argv0);
> -
> -    /* Now create the datadir path name from the bindir path name: */
> -    if (psExecDir && strlen(psExecDir) > 0)
> -    {
> -        snprintf(sDataDir, sizeof(sDataDir), "%s%c%s",
> -                 psExecDir, PATHSEP, BIN2DATADIR);
> -    }
> -    else
> -    {
> -        /* bindir could not be determined, let's assume datadir is relative
> -         * to current working directory... */
> -        strcpy(sDataDir, BIN2DATADIR);
> -    }
> -
> -    /* And finally make a proper absolute path out of datadir: */
> -    File_MakeAbsoluteName(sDataDir);
> -
> -    free(psExecDir);
> +    free(psExecDir) ;
> 
>     /* fprintf(stderr, " WorkingDir = %s\n DataDir = %s\n UserHomeDir = %s\n HatariHomeDir = %s\n",
>             sWorkingDir, sDataDir, sUserHomeDir, sHatariHomeDir); */
> 
> 
> 




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/