$ cat test.c
#include <stdio.h>
int main() {
#ifdef unix
printf("unix");
#else
printf("no unix");
#endif
return 0;
}
$ uname -a
Linux www.the-haleys.com 2.6.39.1-linode34 #1 SMP Tue Jun 21 10:29:24 EDT 2011 i686 GNU/Linux
$ gcc test.c
$ ./a.out
unix
$
#if defined(macintosh)
#include <types.h>
#else
#include <sys/types.h>
#include <sys/time.h>
#endif
#include <stdlib.h>
#include <time.h>
#include "twilight.h"
#include "recycle.h"
#include "tables.h"
#include "lookup.h"
#include "interp.h"
act_comm.c: In function do_delete:
act_comm.c:47: error: PLAYER_DIR undeclared (first use in this function)
act_comm.c:47: error: (Each undeclared identifier is reported only once
act_comm.c:47: error: for each function it appears in.)
make: *** [act_comm.o] Error 1
#ifndef defined(windows) || defined(macintosh) || defined(linux)
#error This operating system is not a supported platform.
#elseif defined(macintosh)
#define PLAYER_DIR ""
#else
#define PLAYER_DIR "../players/"
#end
#include <stdio.h>
int main() {
#ifdef macintosh
printf("mac");
#else
printf("no mac");
#endif
return 0;
}
#if defined(macintosh)
#define PLAYER_DIR ""
#else
#define PLAYER_DIR "../players/"
#endif
#if defined(macintosh)
#define PLAYER_DIR ""
#else
#define PLAYER_DIR "../players/"
#endif
#include <stdio.h>
int main() {
#ifdef macintosh
printf("mac");
#else
printf("no mac");
#endif
return 0;
}
#ifdef computer
printf("running on a computer");
#else
printf("Not running on a computer.");
#endif
#if defined(macintosh)
#define PLAYER_DIR "../player/" /* Player files */
#define PLAYER_BACKUP_DIR "../player/backup/" /* Player backup files */
#define CONCEPT_DIR "../data/concepts/" /* Concept files*/
#define NPC_DIR "../npc/" /* NPC files */
#define AREA_DIR "../area/" /* Area files */
#define ORG_DIR "../orgs/" /* Org files */
#define SURVEY_DIR "../data/survey/" /* Survey files */
#define LOG_DIR "../log/" /* Log files */
#define TEMP_FILE "mudtmp"
#define NULL_FILE "proto.are" /* To reserve one stream */
#endif
#if defined(MSDOS)
#define PLAYER_DIR "../player/" /* Player files */
#define PLAYER_BACKUP_DIR "../player/backup/" /* Player backup files */
#define CONCEPT_DIR "../data/concepts/" /* Concept files*/
#define NPC_DIR "../npc/" /* NPC files */
#define AREA_DIR "../area/" /* Area files */
#define ORG_DIR "../orgs/" /* Org files */
#define SURVEY_DIR "../data/survey/" /* Survey files */
#define LOG_DIR "../log/" /* Log files */
#define TEMP_FILE "mudtmp"
#define NULL_FILE "nul" /* To reserve one stream */
#endif
#if defined(unix)
#define PLAYER_DIR "../player/" /* Player files */
#define PLAYER_BACKUP_DIR "../player/backup/" /* Player backup files */
#define CONCEPT_DIR "../data/concepts/" /* Concept files*/
#define NPC_DIR "../npc/" /* NPC files */
#define AREA_DIR "../area/" /* Area files */
#define ORG_DIR "../data/orgs/" /* Org files */
#define SURVEY_DIR "../data/survey/" /* Survey files */
#define LOG_DIR "../log/" /* Log files */
#define TEMP_FILE "../player/mudtmp"
#define NULL_FILE "/dev/null" /* To reserve one stream */
#endif
#ifdef lol_windows
printf("Yes, configured to use windows.");
#end
I am trying to cleanup the code (and continue to enhance my own knowledge). So, I was using something Darien suggested for finding problems in the code by enforcing the ansi rules. Soo….I did it and got an error I do not understand.
This is what I got:
What does it mean that it is undeclared? I can find it in our .h file where it declares the path for PLAYER_DIR.
Here is the do_delete
Is it the macintosh part has nothing in it?
Thanks in advance.
Arholly