gp works fine with including objective C files via:
{$L file.m}
but does not include the language extension for .m.
Here is a trivial patch:
--- gp.pas (revision 363) +++ gp.pas (working copy) @@ -80,13 +80,13 @@ LanguageNormalizedKind: array [TFileKind] of TFileKind = (fk_None, fk_Program, fk_Program, fk_Program, fk_CFile, fk_Object);
- LanguageSuffixes: array [TFileKind, 1 .. 7] of String (4) = - (('', '', '', '', '', '', ''), - ('.pas', '.p', '.pp', '.dpr', '', '', ''), - ('.pas', '.p', '.pp', '.dpr', '', '', ''), - ('.pas', '.p', '.pp', '.dpr', '', '', ''), - ('.c', '.cc', '.cpp', '.C', '.c++', '.cxx', '.s'), - ('.o', '', '', '', '', '', '')); + LanguageSuffixes: array [TFileKind, 1 .. 8] of String (4) = + (('', '', '', '', '', '', '', ''), + ('.pas', '.p', '.pp', '.dpr', '', '', '', ''), + ('.pas', '.p', '.pp', '.dpr', '', '', '', ''), + ('.pas', '.p', '.pp', '.dpr', '', '', '', ''), + ('.c', '.cc', '.cpp', '.C', '.c++', '.cxx', '.s', '.m'), + ('.o', '', '', '', '', '', '', ''));
It's only applicable to those platforms with Objective C support, but probably wont hurt any to include in gp by default.
Enjoy, Peter.
Peter N Lewis dixit:
gp works fine with including objective C files via:
{$L file.m}
but does not include the language extension for .m.
Isn't .mm Objective-C++ and should be added too?
//mirabile
Thorsten Glaser wrote:
Peter N Lewis dixit:
gp works fine with including objective C files via:
{$L file.m}
but does not include the language extension for .m.
Isn't .mm Objective-C++ and should be added too?
Maybe I'm naive, but if anyone could explain to me how the letters "mm" stand for "Objective-C++", this might really be an enlightenment. Perhaps I should just add any 1/2 letter combination as some kind of C variant. ;-)
Seriously, if there are really the "official" file name suffixes (I don't know Objective-C[++] myself, so I have no idea), I'll add them.
Frank
At 10:46 +0200 5/9/05, Frank Heckenbach wrote:
Thorsten Glaser wrote:
Peter N Lewis dixit:
gp works fine with including objective C files via:
{$L file.m}
but does not include the language extension for .m.
Isn't .mm Objective-C++ and should be added too?
Maybe I'm naive, but if anyone could explain to me how the letters "mm" stand for "Objective-C++", this might really be an enlightenment. Perhaps I should just add any 1/2 letter combination as some kind of C variant. ;-)
I believe .m dates back to the NeXT GNUNextStep days of Objective-C. I have no idea what the m is suppose to stand for if anything.
Seriously, if there are really the "official" file name suffixes (I don't know Objective-C[++] myself, so I have no idea), I'll add them.
Yes, they are official, see:
Preprocessing Mixed-Language Code http://developer.apple.com/documentation/Cocoa/Conceptual/CarbonCocoaDoc/Articles/CompilerPreprocessors.html#//apple_ref/doc/uid/20002400-DontLinkElementID_445753a
Table 1 : Filename extensions and compilation Filename extension Indicates to the compiler .c C source code that must be preprocessed .m Objective-C source code .mm Objective-C++ source code .h C header file (not to be compiled or linked) .cc, .cp, .cxx, .cpp, .c++, .C C++ source code that must be preprocessed
Objective-C and C++ are primarily used under Mac OS X, but are also used under GNUstep and can be used on any platform as far as I know.
Enjoy, Peter.
Frank Heckenbach wrote:
Thorsten Glaser wrote:
Peter N Lewis dixit:
gp works fine with including objective C files via:
{$L file.m}
but does not include the language extension for .m.
Isn't .mm Objective-C++ and should be added too?
Maybe I'm naive, but if anyone could explain to me how the letters "mm" stand for "Objective-C++", this might really be an enlightenment. Perhaps I should just add any 1/2 letter combination as some kind of C variant. ;-)
Seriously, if there are really the "official" file name suffixes (I don't know Objective-C[++] myself, so I have no idea), I'll add them.
Objective-C++ is in the process of being merged into gcc, although currently it is still a development branch for fsf-gcc (see http://gcc.gnu.org/cvs.html#devbranches, objc-improvements-branch). For the suffixes involved, see <http://developer.apple.com/documentation/DeveloperTools/gcc-4.0.0/gcc/ Overall-Options.html>.
Objective-C has been available in fsf-gcc for some time now, see e.g. http://gcc.gnu.org/onlinedocs/gcc-4.0.1/gcc/Objective_002dC.html and http://www.gnustep.org/developers/documentation.html#objc.
Regards,
Adriaan van Os
Adriaan van Os wrote:
Objective-C++ is in the process of being merged into gcc, although currently it is still a development branch for fsf-gcc (see http://gcc.gnu.org/cvs.html#devbranches, objc-improvements-branch). For the suffixes involved, see http://developer.apple.com/documentation/DeveloperTools/gcc-4.0.0/gcc/Overall-Options.html.
Well, I'm now putting in the following. And this doesn't yet include Ada and Fortran. Really looks like I should switch to regular expressions in the future ...
LanguageSuffixes: array [TFileKind, 1 .. 17] of String (4) = (('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''), ('.pas', '.p', '.pp', '.dpr', '', '', '', '', '', '', '', '', '', '', '', '', ''), ('.pas', '.p', '.pp', '.dpr', '', '', '', '', '', '', '', '', '', '', '', '', ''), ('.pas', '.p', '.pp', '.dpr', '', '', '', '', '', '', '', '', '', '', '', '', ''), ('.c', '.cc', '.cpp', '.CPP', '.cp', '.C', '.c++', '.cxx', '.i', '.ii', '.m', '.mi', '.mm', '.M', '.mii', '.S', '.s'), ('.o', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''));
Frank
Adriaan van Os wrote:
Objective-C++ is in the process of being merged into gcc, although currently it is still a development branch for fsf-gcc (see http://gcc.gnu.org/cvs.html#devbranches, objc-improvements-branch). For the suffixes involved, see
http://developer.apple.com/documentation/DeveloperTools/gcc-4.0.0/gcc/Overall-Options.html.
Well, I'm now putting in the following. And this doesn't yet include Ada and Fortran. Really looks like I should switch to regular expressions in the future ...
A standard trick I've used is to just use a string like:
'|.c|.cc|.cpp|.CPP|...|.s|'
and then use Pos( '|'+extension+'|', s ) > 0
A lot lighter weight than PCRE! ;-)
Enjoy, Peter.
LanguageSuffixes: array [TFileKind, 1 .. 17] of String (4) = (('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''), ('.pas', '.p', '.pp', '.dpr', '', '', '', '', '', '', '', '', '', '', '', '', ''), ('.pas', '.p', '.pp', '.dpr', '', '', '', '', '', '', '', '', '', '', '', '', ''), ('.pas', '.p', '.pp', '.dpr', '', '', '', '', '', '', '', '', '', '', '', '', ''), ('.c', '.cc', '.cpp', '.CPP', '.cp', '.C', '.c++', '.cxx', '.i', '.ii', '.m', '.mi', '.mm', '.M', '.mii', '.S', '.s'), ('.o', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''));
Frank
-- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html GPC download signing key: ACB3 79B2 7EB2 B7A7 EFDE D101 CD02 4C9D 0FE0 E5E8
On 9/5/05, Adriaan van Os gpc@microbizz.nl wrote:
Objective-C++ is in the process of being merged into gcc, although currently it is still a development branch for fsf-gcc (see http://gcc.gnu.org/cvs.html#devbranches, objc-improvements-branch). For the suffixes involved, see
Actually, Obj-c++ is already merged into mainline GCC sources and will be released with GCC 4.1.