preprocessor

Changing CCK Title for Form

陌路散爱 提交于 2019-12-10 21:18:36
问题 By default a CCK form creation has a title of the form Create [Your Content Type Name Here] I want to change mine to Register for Such and Such It was suggested that I could use string-override, but I can't find the string to replace. I've also tried writing code to form_alter, but can't seem to figure out how to get the "title" to change. Ideas? 回答1: There are two possibilities, either you can use the theming laying and set $title variable used in the page templage. You can do this with a

Macro to call a function

大兔子大兔子 提交于 2019-12-10 17:46:06
问题 I need a macro (or a function, but preferably a macro) that takes a function name and an unlimited number of arguments, then passes the arguments to the function. Let's say this macro is MACROFOO . #define MACROFOO(function, ...) /* what do I put here?? */ int foo_bar(int x, int y) { // do stuff } int main(void) { int x = 3; int y = 5; MACROFOO(foo_bar, x, y); // calls foo_bar(x, y) } How could I define such a macro? I thought of doing something like: #define MACROFOO(function, args...)

GNU Makefile “preprocessor”?

*爱你&永不变心* 提交于 2019-12-10 17:16:51
问题 Is there an option to output the "preprocessed" makefile, something equivalent to the GCC's -E option? I have a project comprised of an hierarchy of dozens of modules, each with its makefile. The build is invoked from a master makefile. That master makefile contains includes, variable definitions, command line option dependent variables, etc. So, essentially, I am looking for the processed makefile, including all substitutions. 回答1: Not that I'm aware of. The closest thing you can get to this

how to set preprocessor definition of _win32_wce in vs08

南笙酒味 提交于 2019-12-10 15:15:03
问题 How to set preprocessor defination in vs08.By default the value of _win32_wce is $(CEVER) set.but when I build the project the error "c1017 invalid integer constant expression" occur.and warning that environment variable $(CEVER) and $(ceplatform) not set. but when I set it _win32_wce=0x0420 then the all errors removes.but its hard coded.I do't want to do such type.so what should be value of _win32_wce. Note that my poject's earliar solution platform was PocketPC 2003 回答1: This macro : _WIN32

One build for two different versions (4.6,4.7 and 5.0+above) in blackberry

和自甴很熟 提交于 2019-12-10 14:48:22
问题 I want to import facebook libraries for blackberry 5.0 and above and don't want to import those libraries for 4.6 and 4.7. I tried to use preprocessors for 4.7 and above by following below link: http://smartfone-more.blogspot.in/2010/05/coding-for-multiple-blackberry-devices.html now its working fine with JDE 4.7 but not getting expected result for 5.0. Please find the code below which i tried: //#ifdef JDE_4_7_0 import net.rim.device.api.ui.component.ButtonField; //#else import net.rim

Preprocessor logging statements in java

不想你离开。 提交于 2019-12-10 14:02:28
问题 for example I want to replace before compilation: #debug("${enclosing_method} this is debug message for " + userName) with: if (log.isDebugEnabled()) { log.debug("<real method name> this is debug message for " + userName); } 回答1: Don't. Use slf4j instead which allows you to avoid the check with {}. 回答2: Consider using log4j if your example reflects your primary aim. Quote needed: Preprocessor usage is bad OO practice could be of interest as well. 来源: https://stackoverflow.com/questions

cmake: how to check if preprocessor is defined

给你一囗甜甜゛ 提交于 2019-12-10 13:35:16
问题 I can't get cmake to test if a preprocessor has been defined or not. Eg: cmake_minimum_required(VERSION 2.8.9) project (cmake-test) add_definitions(-DOS=LINUX) if(NOT <what condition goes here?>) message(FATAL_ERROR "OS is not defined") endif() The following tests don't work: if (NOT COMMAND OS) if (NOT DEFINED OS) if (NOT OS) I can get it to work by using set() and just testing for a regular cmake variable and then defining the preprocessor macro. Eg: set(OS LINUX) if (OS) add_definitions(

Debug log in Scala with no performance impact

旧巷老猫 提交于 2019-12-10 13:32:33
问题 In languages like C/C++/Objective-C it's common to use preprocessor macros to define logging mechanisms that are not even compiled for released binaries, thus causing no performance hit. Something along the lines of: #ifdef DEBUG printf("some event we want to log\n"); #endif Now, I know there's no preprocessor in Scala. So my question is: what is the best way to implement a mechanism to log program activity for debug purposes, while impacting performance the least when it's turned off? 回答1:

Create a “forCount” control structure in Swift

风流意气都作罢 提交于 2019-12-10 12:55:23
问题 In many projects this control structure is ideal for readability: forCount( 40 ) { // this block is run 40 times } You can do exactly that in objective-C. Given that Swift has a very different approach to macros than objective-c, is there a way to create such a forCount(40) control structure in Swift projects? Some similar concepts in Swift: for _ in 1...40 { // this block is run 40 times } Using an ingenious extension to Int ... 40.times { // this block is run 40 times } 回答1: There are no

Delphi 7 macro preprocessor support

泄露秘密 提交于 2019-12-10 10:37:20
问题 Is there a macro preprocessor for Delphi 7? There isn't one built in so maybe there's a possibilty to use a third party or some other languages preprocessor (like c preprocessor). If there's one, how to set it up for Delphi 7? I'm trying to do function inlining (for speed). Macro preprocessor seems to be the only easy option for delphi. Thanks, Egon 回答1: You can always run an external macro processor, such as m4 or even (shudder) cpp on your code before you compile it. I wouldn't recommend