Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile on Windows 10 with Visual Studio 19 #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
fcpp
*.o
*~
*.obj
*.exe
5 changes: 4 additions & 1 deletion cpp1.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ void __stdargs _XCEXIT(long a) { return; }
FILE_LOCAL ReturnCode output(struct Global *, int); /* Output one character */
FILE_LOCAL void sharp(struct Global *);
INLINE FILE_LOCAL ReturnCode cppmain(struct Global *);

#ifdef _MSC_VER
int fppPreProcess(struct fppTag *tags)
#else
int PREFIX fppPreProcess(REG(a0) struct fppTag *tags)
#endif
{
int i=0;
ReturnCode ret; /* cpp return code */
Expand Down
4 changes: 4 additions & 0 deletions fpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,8 @@ struct fppTag {
/* Switch on WWW-mode */
#define FPPTAG_WEBMODE 33

#ifdef _MSC_VER
int fppPreProcess(struct fppTag *tags);
#else
int PREFIX fppPreProcess(REG(a0) struct fppTag *);
#endif
11 changes: 8 additions & 3 deletions usecpp.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ struct Library *FPPBase=NULL;
#define DEFAULT_CPP_PREFS_FILE "$HOME/cpp.prefs"
#endif

#ifdef _MSC_VER
#define FILE_LOCAL static
#define PREFIX
#endif

FILE_LOCAL char PREFIX *own_input(char *, int, void *);
FILE_LOCAL void PREFIX own_output(int, void *);
FILE_LOCAL void PREFIX own_error(void *, char *, va_list);
Expand Down Expand Up @@ -276,7 +281,7 @@ char GetPrefs(struct fppTag **tagptr, char **string)
unsigned Length_U;
char *PrefsBuffer_PC;
char ret= 0;
char *environ;
char *Environ;

*string = NULL;

Expand All @@ -301,8 +306,8 @@ char GetPrefs(struct fppTag **tagptr, char **string)
}
}

if(environ = getenv("CPP_PREFS")) {
ret= !DoString(tagptr, environ);
if(Environ = getenv("CPP_PREFS")) {
ret= !DoString(tagptr, Environ);
if(ret && *string)
free( *string );
}
Expand Down
20 changes: 20 additions & 0 deletions wMakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
TARGET =fcpp.exe
FLAG= /WX /utf-8 /MP

SOURCES = \
cpp1.c \
cpp2.c \
cpp3.c \
cpp4.c \
cpp5.c \
cpp6.c \
usecpp.c


all: $(TARGET)

$(TARGET):$(SOURCES)
cl $(FLAG) /Fe$(TARGET) $(SOURCES)

clean:
del *.exe & del *.obj