/* WRCNFGAP.i Copyright (C) 2007 Paul C. Pratt You can redistribute this file and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. You should have received a copy of the license along with this file; see the file COPYING. This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. */ /* WRite "CNFGrAPi.h" */ #include "COREDEFS.h" LOCALPROC WriteOSXLocalTalkCNFGRAPI(void) { WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); } LOCALPROC WriteCommonCNFGRAPIContents(void) { WriteDestFileLn("/*"); ++DestFileIndent; WriteDestFileLn( "Configuration options used by platform specific code."); WriteConfigurationWarning(); --DestFileIndent; WriteDestFileLn("*/"); if (gbo_TstCompErr) { WriteDestFileLn("#error \"Testing Compile Time Error\""); } if (gbk_ide_msv == cur_ide) { if (ide_vers >= 8000) { WriteBlankLineToDestFile(); WriteDestFileLn("#define _CRT_SECURE_NO_DEPRECATE 1"); } WriteBlankLineToDestFile(); WriteDestFileLn( "/* ignore warning generated by system includes */"); if (ide_vers >= 6000) { WriteDestFileLn("#pragma warning(push)"); } WriteDestFileLn("#pragma warning(disable : 4201 4115 4214)"); } WriteBlankLineToDestFile(); if (gbk_apifam_osx == gbo_apifam) { if (gbk_targfam_carb == gbo_targfam) { /* kIdeMW8 or kIdeMPW3_6_a1 */ if (gbk_ide_mw8 == cur_ide) { WriteDestFileLn("#include "); } else { WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); #if UseOpenGLinOSX WriteDestFileLn("#include "); #endif } WriteDestFileLn("#define UsingCarbonLib 1"); } else { /* kIdeMW8 or kIdeBashGcc or kIdeAPB */ if (gbk_ide_mw8 == cur_ide) { WriteDestFileLn("#include "); } WriteDestFileLn("#include "); #if UseOpenGLinOSX WriteDestFileLn("#include "); #endif #if UseMachinOSX WriteDestFileLn("#include "); WriteDestFileLn("#include "); #endif WriteDestFileLn("#include "); /* for nanosleep */ if (WantLocalTalk) { WriteOSXLocalTalkCNFGRAPI(); } } } else if (gbk_apifam_cco == gbo_apifam) { WriteDestFileLn("#import "); #if MayUseSound if (MySoundEnabled) { WriteDestFileLn("#include "); WriteDestFileLn("#include "); } #endif #if UseOpenGLinOSX WriteDestFileLn("#include "); #endif WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); if (WantUnTranslocate) { WriteDestFileLn("#include "); } if (WantLocalTalk) { WriteOSXLocalTalkCNFGRAPI(); } } else if (gbk_apifam_xwn == gbo_apifam) { blnr HaveAppPathLink = falseblnr; blnr HaveSysctlPath = (gbk_targfam_fbsd == gbo_targfam); switch (gbo_targfam) { case gbk_targfam_linx: case gbk_targfam_nbsd: case gbk_targfam_dbsd: case gbk_targfam_oind: HaveAppPathLink = trueblnr; break; default: break; } if (gbk_targfam_minx == gbo_targfam) { WriteDestFileLn( "/* get nanosleep and gettimeofday. ugh */"); WriteDestFileLn("#define _POSIX_SOURCE 1"); WriteDestFileLn("#define _POSIX_C_SOURCE 200112L"); } WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); #if 1 WriteDestFileLn("#include "); #endif /* if (WantActvCode) */ { /* also now used for export file */ WriteDestFileLn("#include "); } #if MayUseSound if ((gbk_sndapi_alsa == gbo_sndapi) || (gbk_sndapi_ddsp == gbo_sndapi)) { WriteDestFileLn("#include "); } #endif if (HaveAppPathLink /* for readlink */ #if MayUseSound || (gbk_sndapi_ddsp == gbo_sndapi) #endif ) /* for write */ { WriteDestFileLn("#include "); } if (HaveSysctlPath) { WriteDestFileLn("#include "); } #if MayUseSound if (MySoundEnabled) { switch (gbo_sndapi) { case gbk_sndapi_alsa: WriteDestFileLn("#include "); #if 0 WriteDestFileLn("#include "); #endif break; case gbk_sndapi_ddsp: WriteDestFileLn("#include "); if (gbk_targfam_obsd == gbo_targfam) { WriteDestFileLn("#include "); } else { WriteDestFileLn("#include "); } break; default: break; } } #endif WriteBlankLineToDestFile(); WriteCompCondBool("CanGetAppPath", HaveAppPathLink || HaveSysctlPath); WriteCompCondBool("HaveAppPathLink", HaveAppPathLink); if (HaveAppPathLink) { WriteBgnDestFileLn(); WriteCStrToDestFile("#define TheAppPathLink \""); switch (gbo_targfam) { case gbk_targfam_nbsd: WriteCStrToDestFile("/proc/curproc/exe"); break; case gbk_targfam_dbsd: WriteCStrToDestFile("/proc/curproc/file"); break; case gbk_targfam_oind: WriteCStrToDestFile("/proc/self/path/a.out"); break; case gbk_targfam_linx: default: WriteCStrToDestFile("/proc/self/exe"); break; } WriteCStrToDestFile("\""); WriteEndDestFileLn(); } WriteCompCondBool("HaveSysctlPath", HaveSysctlPath); #if MayUseSound if (MySoundEnabled) { if (gbk_sndapi_ddsp == gbo_sndapi) { WriteBgnDestFileLn(); WriteCStrToDestFile("#define AudioDevPath \""); switch (gbo_targfam) { case gbk_targfam_nbsd: case gbk_targfam_obsd: WriteCStrToDestFile("/dev/audio"); break; case gbk_targfam_fbsd: case gbk_targfam_dbsd: default: WriteCStrToDestFile("/dev/dsp"); break; } WriteCStrToDestFile("\""); WriteEndDestFileLn(); } } #endif } else if (gbk_apifam_nds == gbo_apifam) { WriteDestFileLn("#define ARM9 1"); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); } else if (gbk_apifam_gtk == gbo_apifam) { WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); } else if (gbk_apifam_sdl == gbo_apifam) { WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); } else if (gbk_apifam_sd2 == gbo_apifam) { WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); } else if (gbk_apifam_win == gbo_apifam) { if ((gbk_ide_mvc == cur_ide) && (gbk_targfam_wnce == gbo_targfam)) { WriteDestFileLn("#define WIN32 1"); WriteDestFileLn("#define _WIN32 1"); WriteDestFileLn("#define WINNT 1"); WriteDestFileLn("#define UNDER_CE 1"); WriteDestFileLn("#define __CEGCC__ 1"); WriteDestFileLn("#define __CEGCC32__ 1"); WriteDestFileLn("#define __MINGW32__ 1"); WriteDestFileLn("#define __MINGW32CE__ 1"); WriteDestFileLn("#define __COREDLL__ 1"); WriteDestFileLn("#define UNICODE 1"); WriteDestFileLn("#define _UNICODE 1"); WriteDestFileLn("#define _M_ARM 1"); WriteBlankLineToDestFile(); } if (gbk_ide_mw8 == cur_ide) { WriteDestFileLn("#include "); } else { WriteDestFileLn("#include "); WriteDestFileLn("#include "); if (gbk_ide_lcc == cur_ide) { WriteDestFileLn("#include "); WriteDestFileLn("#include "); } } WriteDestFileLn("#include "); WriteDestFileLn("#include "); if (gbk_targfam_wnce == gbo_targfam) { WriteDestFileLn("#include "); WriteDestFileLn("#include "); } if (gbk_ide_mvc == cur_ide) { WriteBlankLineToDestFile(); WriteDestFileLn("#define _tWinMain WinMain"); } if (gbk_ide_plc == cur_ide) { WriteDestFileLn("#define _MAX_PATH MAX_PATH"); } } else { if (gbk_ide_mw8 == cur_ide) { WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#define ShouldDefineQDGlobals 0"); } else if (gbk_ide_mpw == cur_ide) { WriteDestFileLn("#include "); if (gbk_cpufam_68k != gbo_cpufam) { WriteDestFileLn("#include "); } WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); if (gbk_cpufam_68k == gbo_cpufam) { WriteDestFileLn("#include "); } WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); WriteDestFileLn("#include "); } } if ((gbk_ide_msv == cur_ide) && (ide_vers >= 6000)) { WriteBlankLineToDestFile(); WriteDestFileLn("/* restore warnings */"); WriteDestFileLn("#pragma warning(pop)"); } WriteBlankLineToDestFile(); if (gbk_cpufam_68k == gbo_cpufam) { if (gbk_ide_mpw == cur_ide) { WriteDestFileLn("#define ShouldUnloadDataInit 1"); WriteDestFileLn("#define Windows85APIAvail 0"); WriteDestFileLn("#define NeedLongGlue 1"); } } #if MayUseSound if (MySoundEnabled) { if (gbk_sndapi_alsa == gbo_sndapi) if (gbk_cpufam_arm == gbo_cpufam) { WriteDestFileLn("#define RaspbianWorkAround 1"); } } #endif if (HaveMacBundleApp) { WriteDestFileLn("#define MyAppIsBundle 1"); } if (gbk_apifam_cco == gbo_apifam) { WriteCompCondBool("WantUnTranslocate", WantUnTranslocate); } if (gbk_apifam_win == gbo_apifam) { if (WantIconMaster) { WriteDestFileLn("#define InstallFileIcons 1"); } } if ((gbk_apifam_mac == gbo_apifam) || (gbk_apifam_osx == gbo_apifam)) { WriteBgnDestFileLn(); WriteCStrToDestFile("#define kMacCreatorSig "); WriteSingleQuoteToDestFile(); WriteCStrToDestFile(kMacCreatorSig); WriteSingleQuoteToDestFile(); WriteEndDestFileLn(); } }