Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #8776
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.glorb.com!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail |
|---|---|
| Date | Thu, 13 Oct 2011 22:49:32 -0400 |
| From | Arne Vajhøj <arne@vajhoej.dk> |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 |
| MIME-Version | 1.0 |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: preprocessor idea |
| References | <j721b6$dam$1@online.de> <4e94ce75$0$284$14726298@news.sunsite.dk> <9foia2FjbkU1@mid.individual.net> |
| In-Reply-To | <9foia2FjbkU1@mid.individual.net> |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 8bit |
| Lines | 50 |
| Message-ID | <4e97a33b$0$282$14726298@news.sunsite.dk> (permalink) |
| Organization | SunSITE.dk - Supporting Open source |
| NNTP-Posting-Host | 72.192.23.141 |
| X-Trace | news.sunsite.dk DXC=0VMKRiGYdP04KInH<KUX42YSB=nbEKnk;`W>_f<AngK=JPe3\kP5EU1KBm9cfh9BS4M2;kT<[:>[1I\JIQQf>O04A\6hR_;=AM4 |
| X-Complaints-To | staff@sunsite.dk |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8776 |
Show key headers only | View raw
On 10/13/2011 12:35 PM, Robert Klemme wrote:
> On 12.10.2011 01:17, Arne Vajhøj wrote:
>> On 10/11/2011 2:19 PM, Philipp Kraus wrote:
>>> I use within my Java code different external libraries (DLL), so I have
>>> create a string array with their names
>>> so the libraries can be load with System.load / System.loadLibrary.
>>>
>>> I build the libraries (C++ code) with a toolchain and I use a lot of
>>> preprocessor commands within
>>> the C++ code, so I can enable or disable some function and so the using
>>> of the libraries eg:
>>>
>>> c++:
>>> #ifdef lib1
>>> #endif
>>>
>>> #ifdef lib2
>>> #endif
>>>
>>> So my Java code must load lib1 and lib2 if both defs are set. Java does
>>> not support any preprocessor
>>> flags, but in this case I need a tip for creating a flexiable Java code
>>> during the class is compiled
>>> (eg: ifdef1 = true => String[] javaarray = {"lib1"}). Do you know any
>>> idea for this problem?
>>
>> Run the Java code through the C preprocessor with the same defines.
>>
>> String[] javaarray = {
>> "None"
>> #ifdef lib1
>> ,"lib1"
>> #endif
>> #ifdef lib1
>> ,"lib1"
>> #endif
>> };
>
> I do not think it's worthwhile to open that can of worms for this
> decision. After all getting rid of the CPP is one of the major
> advantages of Java over C++ (even Stroustrup regrets not having ripped
> it out of C++) and complicating the Java build process just for that
> decision seems too heavy - especially since there are other solutions
> available.
What other solution achieve the same?
Arne
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
preprocessor idea Philipp Kraus <philipp.kraus@flashpixx.de> - 2011-10-11 20:19 +0200
Re: preprocessor idea Robert Klemme <shortcutter@googlemail.com> - 2011-10-11 21:57 +0200
Re: preprocessor idea markspace <-@.> - 2011-10-11 13:14 -0700
Re: preprocessor idea Arne Vajhøj <arne@vajhoej.dk> - 2011-10-11 19:17 -0400
Re: preprocessor idea Robert Klemme <shortcutter@googlemail.com> - 2011-10-13 18:35 +0200
Re: preprocessor idea Arne Vajhøj <arne@vajhoej.dk> - 2011-10-13 22:49 -0400
Re: preprocessor idea Robert Klemme <shortcutter@googlemail.com> - 2011-10-16 23:56 +0200
Re: preprocessor idea Arne Vajhøj <arne@vajhoej.dk> - 2011-10-16 22:32 -0400
Re: preprocessor idea Robert Klemme <shortcutter@googlemail.com> - 2011-10-17 18:53 +0200
Re: preprocessor idea Roedy Green <see_website@mindprod.com.invalid> - 2011-10-12 07:04 -0700
csiph-web