1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-26 15:03:27 +01:00

fix define checks

This commit is contained in:
Michael Rose 2013-08-19 09:23:40 +02:00
parent 76473ea8b4
commit 4a8146b943

9
main.c
View File

@ -40,7 +40,7 @@ void setdir()
{ {
#ifdef WIN32 #ifdef WIN32
strcpy(dir, "%appdata%/.tox/"); strcpy(dir, "%appdata%/.tox/");
#elif __APPLE__ #elif defined(__APPLE__)
strcpy(dir, "~/Library/Application Support/.tox/"); strcpy(dir, "~/Library/Application Support/.tox/");
#elif defined(linux) #elif defined(linux)
strcpy(dir, "~/.tox/"); strcpy(dir, "~/.tox/");
@ -88,7 +88,7 @@ static Messenger *init_tox()
setname(m, (uint8_t *) "Cool guy", sizeof("Cool guy")); setname(m, (uint8_t *) "Cool guy", sizeof("Cool guy"));
#elif defined(WIN32) #elif defined(WIN32)
setname(m, (uint8_t *) "I should install GNU/Linux", sizeof("I should install GNU/Linux")); setname(m, (uint8_t *) "I should install GNU/Linux", sizeof("I should install GNU/Linux"));
#elif __APPLE__ #elif defined(__APPLE__)
setname(m, (uint8_t *) "Hipster", sizeof("Hipster")); //This used to users of other Unixes are hipsters setname(m, (uint8_t *) "Hipster", sizeof("Hipster")); //This used to users of other Unixes are hipsters
#else #else
setname(m, (uint8_t *) "Registered Minix user #4", sizeof("Registered Minix user #4")); setname(m, (uint8_t *) "Registered Minix user #4", sizeof("Registered Minix user #4"));
@ -108,7 +108,7 @@ int init_connection(void)
#if WIN32 #if WIN32
FILE *fp = fopen("%appdata%/.tox/DHTservers", "r"); FILE *fp = fopen("%appdata%/.tox/DHTservers", "r");
#elif __APPLE__ #elif defined(__APPLE__)
FILE *fp = fopen("~/Library/Application Support/.tox/DHTservers", "r"); FILE *fp = fopen("~/Library/Application Support/.tox/DHTservers", "r");
#else #else
FILE *fp = fopen("~/.tox/DHTservers", "r"); FILE *fp = fopen("~/.tox/DHTservers", "r");
@ -314,8 +314,7 @@ int main(int argc, char *argv[])
DATA_FILE = malloc(strlen(user_config_dir) + strlen(CONFIGDIR) + strlen("data") + 1); DATA_FILE = malloc(strlen(user_config_dir) + strlen(CONFIGDIR) + strlen("data") + 1);
strcpy(DATA_FILE, user_config_dir); strcpy(DATA_FILE, user_config_dir);
strcat(DATA_FILE, CONFIGDIR); strcat(DATA_FILE, CONFIGDIR);
strcat(DATA_FILE, dir); strcat(DATA_FILE, "data");
DATA_FILE = strdup("data");
} }
} }