Ignore:
Timestamp:
Apr 4, 2013 9:51:57 PM (8 years ago)
Author:
str4d <str4d@…>
Branches:
master
Children:
45a38a5, 9550de67
Parents:
f6190dd
Message:

Marked Windows-specific code in preparation for a cross-platform binary

File:
1 edited

Legend:

Unmodified
Added
Removed
  • installer/c/i2pExe/i2p.c

    rf6190dd r7f471910  
    88#include "errors.h"
    99
    10 #include <windows.h>
    11 #include <stdio.h>   
     10#ifdef _WIN32
     11#include <windows.h>
     12#endif
     13
     14#include <stdio.h>
    1215#include <malloc.h>
    1316#include <sys/stat.h>
    1417
    1518//BOOL MoveFontPropertiesFile(const char *path);
     19#ifdef _WIN32
    1620void SetWorkingDirectory(char *path);
     21#endif
    1722void readOptions(char***, int*);
    1823//BOOL localJREExists(const char*);
    19 BOOL exist(const char*);
     24//BOOL exist(const char*);
    2025
    2126// defined in java.c
     
    3540        //char** new_argv;
    3641        //int i;
     42#ifdef _WIN32
    3743        char currentDirectory[MAX_PATH+1];
     44#endif
    3845
    3946        // Set/get the correct working directory.
     47#ifdef _WIN32
    4048        SetWorkingDirectory(currentDirectory);
     49#endif
    4150
    4251        // Read in options from disk (launch.properties)
     
    7180        case ERROR_COULDNT_INITIALIZE_JVM:
    7281        case ERROR_COULDNT_LOAD_JVM:
     82#ifdef _WIN32
    7383                if (MessageBox(NULL, "I2P needs the Java Runtime Environment 5.0 or above. Click OK to go to www.java.com, where you can install Java.",
    7484                       "I2P Launcher Error",
    7585                       MB_ICONWARNING | MB_OKCANCEL) == IDOK)
    7686                        ShellExecute(NULL, NULL, "http://www.java.com/", "", "", SW_SHOWNORMAL);
     87#endif
    7788                break;
    7889        case ERROR_COULDNT_PARSE_ARGUMENTS:
     90#ifdef _WIN32
    7991                MessageBox(NULL, "I2P failed to parse the commandline arguments to Java.\n"
    8092                        "Please download and install I2P again.",
    8193                        "I2P Launcher Error", MB_OK);
     94#endif
    8295                break;
    8396        case ERROR_STARTING_PROGRAM:
     97#ifdef _WIN32
    8498                MessageBox(NULL, "I2P was unable to load.\n"
    8599                                "Please download and install I2P again.",
    86100                                "I2P Launcher Error", MB_OK);
     101#endif
    87102                break;
    88103        }
     
    169184 * Sets the current working directory to wherever I2P.exe is located
    170185 */
     186#ifdef _WIN32
    171187static void
    172188SetWorkingDirectory(char *path) {
     
    176192        GetCurrentDirectory(MAX_PATH + 1, path);
    177193}
     194#endif
    178195
    179196/**
     
    209226}
    210227*/
    211 
     228/*
    212229BOOL exist(const char *filename) {
    213230        struct stat s;
    214231        return stat(filename, &s) == 0 ? TRUE : FALSE;
    215232}
    216 
    217 
     233*/
     234
     235#ifdef _WIN32
    218236__declspec(dllimport) char **__initenv;
    219237
     
    234252    return ret;
    235253}
     254#endif
Note: See TracChangeset for help on using the changeset viewer.