summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-01-19 13:00:09 +0000
committerAsh Wolf <ninji@wuffs.org>2023-01-19 13:00:09 +0000
commit4d670146b4054e11e90227f96a3a1c66410e8d0b (patch)
tree8dca31cf9ee497ee59e833f48dd76c81aaef3cf5 /includes
parent5d0bbb19cc133753cebda7099e46d4b2084336c6 (diff)
downloadMWCC-4d670146b4054e11e90227f96a3a1c66410e8d0b.tar.gz
MWCC-4d670146b4054e11e90227f96a3a1c66410e8d0b.zip
more cross-platform work
Diffstat (limited to '')
-rw-r--r--includes/cmdline.h2
-rw-r--r--includes/common.h9
-rw-r--r--includes/compiler/CParser.h2
-rw-r--r--includes/compiler/ObjGenMachO.h55
-rw-r--r--includes/plugin.h2
5 files changed, 43 insertions, 27 deletions
diff --git a/includes/cmdline.h b/includes/cmdline.h
index cfa6c3d..d25e70b 100644
--- a/includes/cmdline.h
+++ b/includes/cmdline.h
@@ -773,7 +773,7 @@ extern void FreeIncludeFile(Handle text);
/* CLLicenses.c */
extern void License_Initialize(void);
extern void License_Terminate(void);
-extern SInt32 License_Checkout(/* unknown args */);
+extern SInt32 License_Checkout(const char *featureName, const char *licenseVersion, Boolean flag, char *errorBuf);
extern void License_Refresh(/* unknown args */);
extern void License_Checkin(/* unknown args */);
extern void License_AutoCheckin(void);
diff --git a/includes/common.h b/includes/common.h
index baedfe9..1b0ce22 100644
--- a/includes/common.h
+++ b/includes/common.h
@@ -19,13 +19,16 @@
#undef toupper
#undef tolower
+#ifdef CW_CLT
// What the fuck is this haha
// typedef char * va_list;
#define va_start(a,b) (a = ((va_list) __builtin_next_arg(b)))
#define va_arg(a,b) (*(b *) (void *) ((a = (char *) (((((unsigned long)(a)) + ((__alignof__ (b) == 16) ? 15 : 3)) & ~((__alignof__ (b) == 16) ? 15 : 3)) + ((sizeof (b) + 3) & ~3))) - ((sizeof (b) + 3) & ~3)))
#define va_end(a) ((void)0)
-
#define alloca(x) __alloca(x)
+#else
+#include <stdarg.h>
+#endif
#define CW_INLINE inline
@@ -168,7 +171,11 @@ enum {
typedef struct FSSpec {
SInt16 vRefNum;
SInt32 parID;
+#ifdef CW_CLT
Str255 name;
+#else
+ Str63 name;
+#endif
} FSSpec;
typedef struct FInfo {
diff --git a/includes/compiler/CParser.h b/includes/compiler/CParser.h
index 65d046a..6b95561 100644
--- a/includes/compiler/CParser.h
+++ b/includes/compiler/CParser.h
@@ -342,7 +342,7 @@ extern SInt32 CParser_GetUniqueID(void);
extern void CParser_PrintUniqueID(char *buf);
extern void CParser_SetUniqueID(SInt32 id);
extern HashNameNode *CParser_GetUniqueName(void);
-extern HashNameNode *CParser_NameConcat(char *a, char *b);
+extern HashNameNode *CParser_NameConcat(const char *a, const char *b);
extern HashNameNode *CParser_AppendUniqueName(char *prefix);
extern HashNameNode *CParser_AppendUniqueNameFile(char *prefix);
extern Boolean IsTempName(HashNameNode *name);
diff --git a/includes/compiler/ObjGenMachO.h b/includes/compiler/ObjGenMachO.h
index edc4944..4088a7f 100644
--- a/includes/compiler/ObjGenMachO.h
+++ b/includes/compiler/ObjGenMachO.h
@@ -2,7 +2,14 @@
#define COMPILER_OBJGENMACHO_H
#include "compiler/common.h"
+
+#ifdef CW_TARGET_MACH
#include "compiler/MachO.h"
+typedef MachOSection *SectionHandle;
+#define ObjGen_SourceRef ObjGen_Line
+#else
+typedef Section SectionHandle;
+#endif
typedef enum MWReloc {
MW_RELOC_0 = 0,
@@ -16,11 +23,31 @@ typedef enum MWReloc {
MW_RELOC_9 = 9
} MWReloc;
-extern Boolean declare_readonly;
-extern SInt32 symdeclend;
extern SInt32 symdecloffset;
-// this conflicts with other files
-//extern SInt32 nexttypeid;
+extern SInt32 symdeclend;
+
+extern void ObjGen_Setup(void);
+extern void ObjGen_Finish(void);
+extern void ObjGen_Cleanup(void);
+extern void ObjGen_CodeCleanup(void);
+extern void ObjGen_SetupSym(void);
+extern void ObjGen_SymFunc(Object *function);
+extern void ObjGen_SegmentName(void);
+extern void ObjGen_SrcBreakName(HashNameNode *name, SInt32 fileModDate, Boolean flag);
+extern void ObjGen_DeclareData(Object *object, char *data, OLinkList *olinklist, UInt32 size);
+extern void ObjGen_DeclareReadOnlyData(Object *object, char *data, OLinkList *olinklist, UInt32 size);
+extern void ObjGen_DeclareSwitchTable(Object *tableobj, Object *funcobj);
+extern SectionHandle ObjGen_DeclareCode(Object *object, SInt32 size);
+extern void ObjGen_DeclareEntry(Object *object, SInt32 offset);
+extern void ObjGen_DeclareSymInfo(void);
+extern void ObjGen_DeclareExceptionTables(Object *object, SInt32 codesize, char *data, SInt32 len, OLinkList *refs);
+extern void ObjGen_DeclareTracebackTable(Object *tableobj, void *data, SInt32 size);
+extern void ObjGen_RelocateObj(SectionHandle section, SInt32 offset, Object *object, MWReloc mwRelType);
+extern void ObjGen_SourceRef(UInt32 line, UInt32 offset);
+extern GList *ObjGen_GetSectionGList(SectionHandle section);
+
+#ifdef CW_TARGET_MACH
+extern Boolean declare_readonly;
extern GList symtypemodule;
extern SInt32 last_base_offset[N_SECTIONS];
extern MachOSection *Sections[N_SECTIONS];
@@ -30,26 +57,13 @@ extern SInt32 pic_base_offset;
extern SInt32 ObjGen_MakeSectReloc(MachOSection *section);
extern SInt32 ObjGen_GetHashNodeRelocID(Object *object, MachOSection *section, SInt32 value);
-extern void ObjGen_Setup(void);
extern void ObjGen_DeclareFloatConst(Object *object);
extern void ObjGen_DeclareVectorConst(Object *object);
-extern void ObjGen_Finish(void);
-extern void ObjGen_Cleanup(void);
-extern void ObjGen_SetupSym(void);
-extern void ObjGen_DeclareData(Object *object, char *data, OLinkList *olinklist, UInt32 size);
-extern void ObjGen_DeclareReadOnlyData(Object *object, char *data, OLinkList *olinklist, UInt32 size);
-extern void ObjGen_SegmentName(void);
-extern void ObjGen_SymFunc(Object *function);
extern void ObjGenMach_SymFuncEnd(Object *function, UInt32 offset);
extern void ObjGen_CodeSetup(void);
-extern void ObjGen_CodeCleanup(void);
-extern void ObjGen_SrcBreakName(HashNameNode *name, SInt32 fileModDate, Boolean flag);
-extern GList *ObjGen_GetSectionGList(MachOSection *section);
extern MachOSection *ObjGen_DeclareFunction(Object *object);
-extern MachOSection *ObjGen_DeclareCode(Object *object);
extern MachOSection *ObjGen_DeclareMachSection(/* unknown args */);
extern void ObjGen_Relocate(MachOSection *section, SInt32 offset, SInt32 relocID, RelocType relocType, MWReloc mwRelType);
-extern void ObjGen_RelocateObj(MachOSection *section, SInt32 offset, Object *object, MWReloc mwRelType);
extern SInt32 ObjGen_DeclareLiteralString(UInt32 len, char *data, SInt32 align);
extern UInt32 ObjGen_GetSectSize(MachOSection *section);
extern void ObjGen_GetExtName(SInt32 id, char *buf);
@@ -59,17 +73,12 @@ extern Boolean ObjGen_IsExternalVar(SInt32 id);
extern SInt32 ObjGen_DeclareInit(UInt32 len, char *data, SInt32 align);
extern void CodeGen_GenDynLinkStub(MachOSection *a, MachOSection *b, SInt32 relocID);
extern void ObjGen_DeclarePICBase(Object *object, SInt32 offset);
-extern void ObjGen_DeclareEntry(Object *object, SInt32 offset);
-extern void ObjGen_DeclareExceptionTables(Object *object, SInt32 codesize, char *data, SInt32 len, OLinkList *refs);
extern void ObjGen_DeclareCodeLabel(Object *labelobj, SInt32 offset, Object *funcobj);
-extern void ObjGen_DeclareSwitchTable(Object *tableobj, Object *funcobj);
-extern void ObjGen_DeclareTracebackTable(Object *tableobj, void *data, SInt32 size);
-extern void ObjGen_DeclareSymInfo(void);
-extern void ObjGen_Line(UInt32 line, UInt32 offset);
extern void ObjGen_OutputDebugInfo(Object *funcobj);
extern SInt32 ObjGen_OutputStab(SymbolData *symbol, SInt32 strIdx);
extern void ObjGen_SetSectName(/* unknown args */);
extern void ObjGen_DeclareInitFunction(Object *funcobj);
extern Boolean ObjGen_IsExported(Object *object);
+#endif
#endif
diff --git a/includes/plugin.h b/includes/plugin.h
index 6fad976..01b0c9a 100644
--- a/includes/plugin.h
+++ b/includes/plugin.h
@@ -270,7 +270,7 @@ extern CWResult UCBCacheAccessPathList(CWPluginContext context);
extern CWResult UCBSecretAttachHandle(CWPluginContext context, Handle handle, CWMemHandle *memHandle);
extern CWResult UCBSecretDetachHandle(CWPluginContext context, CWMemHandle memHandle, Handle *handle);
extern CWResult UCBSecretPeekHandle(CWPluginContext context, CWMemHandle memHandle, Handle *handle);
-extern CWResult UCBCheckoutLicense(CWPluginContext context, const char *a, const char *b, SInt32 c, void *d, SInt32 *cookiePtr);
+extern CWResult UCBCheckoutLicense(CWPluginContext context, const char *featureName, const char *licenseVersion, SInt32 flags, void *reserved, SInt32 *cookie);
extern CWResult UCBCheckinLicense(CWPluginContext context, SInt32 cookie);
extern CWResult UCBResolveRelativePath(CWPluginContext context, const CWRelativePath *relativePath, CWFileSpec *fileSpec, Boolean create);
extern CWResult UCBMacOSErrToCWResult(CWPluginContext context, OSErr err);