Questions tagged [compiler-directives]

Compiler directive is a language construct that specifies how a compiler (or assembler or interpreter) should process its input.

Compiler directive is a language construct that specifies how a compiler (or assembler or interpreter) should process its input.

125 questions
0
votes
0 answers

Defining compiler directive in different file C++

Consider following code snippet, // header file #define TEXT_ENUM //////////// HERE #ifdef TEXT_ENUM #define TEXT_HANDLING_MACRO \ static const char * TEXT[]; \ static const char *…
Oli
  • 1,313
  • 14
  • 31
0
votes
2 answers

static variable in #define directive c++

Is it possible to declare static variable in a #define directive? // header file #define TEXT_ENUM #ifdef TEXT_ENUM #define TEXT_HANDLING_MACRO \ static const char * TEXT[]; \ static const char *…
Oli
  • 1,313
  • 14
  • 31
0
votes
1 answer

"Burning" the result of a #define

Suppose a define like this #define myDate [NSDate date] every time I use it, it gives me the current date, what is ok. What I want is to store the date the code was compiled. Can I do that with defines or using any other way? I want the date to be…
Mickey
  • 3
  • 1
0
votes
3 answers

Sharing Data between two Directives in AngularJS

I have the following code:
I also have two directives which get some data from the data factory. I…
Sean D
  • 356
  • 5
  • 20
0
votes
2 answers

Working of the compiler directive in C++

The #define compiler directive seems rather strange to me. I have read that no memory is allocated to it . #include #define test 50 int main() { cout<
user4375224
0
votes
1 answer

Macro for a multi line C preprocessor directive

I was trying to create a shorthand for the following code. #ifdef TEST_DEF #define MY_TEST_DEF TEST_DEF #else #define MY_TEST_DEF 120 #endif How do I write the above code as a single line macro SAFE_DEF(TEST_DEF,MY_TEST_DEF,120)
Jean
  • 21,665
  • 24
  • 69
  • 119
0
votes
1 answer

Linking to modules in external directory Compaq Visual Fortran command prompt

I know that this question is VERY specific, but I am using "Compaq Visual Fortran Optimizing Compiler, Version 6.5" (Fortran 90). To compile, e.g., I use: f90 constants.f90 main.f90 /compile_only And I'm not sure how to link aside from using the…
Charles
  • 947
  • 1
  • 15
  • 39
0
votes
1 answer

CLIPS constant compiler directive

Similar to the compiler directive for constants in C, is there a way I can do the following in CLIPS? #define INFINITY 1000000000 (deftemplate foo (slot num (type INTEGER) (default INFINITY)) ) ... (defrule bar (foo (num INFINITY)) …
slanger
  • 35
  • 1
  • 4
0
votes
0 answers

Warnings for bad XML comments - How to enable?

I want warnings for bad XML comments. They're turned on in Project Options and there are no Compiler Directives inside the unit with the bad xml comments, but I'm not getting any warnings. What else could hide them? Günther the Beautiful gave the…
0
votes
1 answer

DEBUG directive not working

In my .NET MVC 4 site I use #If DEBUG Then in a few places. Lately I've noticed that there seems to be some issues with the DEBUG variable. This issue keeps happening Here is some code I put in a controller action to test my problem: If DEBUG Then …
greenonion
  • 105
  • 1
  • 7
0
votes
1 answer

How to force execution of value assignment in blocks of type <%=value%>

is there a directive or a instruction to force the execution of the blocks of type <%=value%> in webpages?, because i have a web project in which i have a block of that type and it just evaluates the very first time (when value is ""), but if i…
0
votes
4 answers

Where to write @property directive in Objective-C?

code1 @interface Rectangle : NSObject { int width,height; } @property int width,height; code2 @interface Rectangle : NSObject @property int width,height; { int width,height; } Can anyone tell me, what is different between them? And in…
Ben
  • 751
  • 1
  • 7
  • 14
0
votes
1 answer

How to check if the function is available on compiler?

Is there a way to detect in compilation-time, if a function is built-in on compiler? e.g, something like this: #ifndef ITOA_FUNCTION #define itoa myitoaimplementation #endif Thanks in advance.
Jack
  • 16,276
  • 55
  • 159
  • 284
-1
votes
1 answer

Which program in the compiler takes care of the preprocessors?

Compiler is a combination of many programs. So which program takes care of which part during compilation? I read somewhere that the preprocessor program takes care of the C preprocessor directives(macros). Is that correct?
Pratik P
  • 47
  • 3
  • 10
-1
votes
1 answer

c# compiler directives use in a continuous delivery pipeline

My team uses compiler directives to create different versions of our product for different stages (debug, test, release) but now we want to move a CI/CD strategy and we are discussing whether it is a good idea to use compiler directives at all since…
1 2 3
8
9