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
1
vote
2 answers

Omitting code: Any difference between Conditional Attribute and pre-processing directive?

I am wondering what the difference is between #define MYSYMBOL #if MYSYMBOL public void foo () { // ... } #endif and #define MYSYMBOL [Conditional("MYSYMBOL")] public void foo () { // ... } ? Maybe it's obvious but if someone could…
marc wellman
  • 5,808
  • 5
  • 32
  • 59
0
votes
1 answer

How to prevent an application from communicating with the outside world during debug/testing?

I have two separate applications (both part of the same system) that share a common database. One application is a "gateway" that is responsible for communicating with the outside world and the other is a desktop client that local users on the LAN…
Casey Wilkins
  • 2,555
  • 2
  • 23
  • 31
0
votes
1 answer

default value for macro declaration

When a macro is created but no value is assigned, is there a default value? #define MACRO (end of line). Macro definition has the syntax: #define . Even if we don't pass a value, the macro is created, which can be verified by the…
Darvid
  • 15
  • 2
0
votes
1 answer

Visual Studio C# Project Template #if DEBUG #endif disappear in produced projects

I have Visual Studio C# project template with #if DEBUG #endif directives like this: #if DEBUG ... #endif But when I creating project from this template it doesn't contain this part. Can I somehow make it to be in projects that created from this…
Kazbek
  • 182
  • 11
0
votes
0 answers

Local labels in emu8086

until now I have been using DOSBox and TASM to compile, link and run my 8086 code. Whenever I wanted to use local labels I would have just added LABELS @@ at the start of each code file and used @@Label_Name. Now I want to change into emu8086. It…
Algo
  • 178
  • 7
0
votes
1 answer

Release build .dll still contains code that should be removed via preprocessor directives

I have a c# .net core project that is using preprocessor directives ( #if DEBUG) to enable unsafe SSL Connections during debugging. Now when I release-build the whole project and open the generated dll with dotPeek I still find the code surrounded…
lb0
  • 23
  • 4
0
votes
0 answers

Is there a way to disregard remainder of python script file?

I am working on a refactoring a Python program. I have copied and pasted some messy source files into new Python modules and I'm working through the module top-to-bottom cleaning it up etc. As a result, the bottom part of my module is a mess of code…
ec2011
  • 570
  • 6
  • 20
0
votes
1 answer

compiler directive defensive programming for adding ints to nsmuatablearray FMDB/EGODB

I would like to throw a warning message when users try to add an int to an nsmutablearray basically any insert statement that includes values that are not nsstring / nsnumber cause run time crashes. It's exactly the same crash you get when you type…
johndpope
  • 5,035
  • 2
  • 41
  • 43
0
votes
0 answers

Why does MSBuild mark #Disable and #Enable directives as Error BC30248?

I'm working in an environment in which all projects are placed into a Global Solution irrelevant of the specific business areas of the projects. So the solution is a monstrosity. I'm accustomed to a more segregated approach based on separation of…
Mark
  • 1,667
  • 2
  • 24
  • 51
0
votes
1 answer

Non-specific `include file name - System Verilog compiler directives

I want to use the `include directive to call upon a non-specific file name. For example, there is this file name "name_defines.svh" in some other directory. Since the "name" of "name_defines.svh" changes(it can be eg, a_defines.svh, b_defines.svh..…
0
votes
2 answers

runtime directives in config

well, let's say i've got the following if statement: if (a) { // do something. } is it possible to run the statement only if a certain value in the app.config is true without making another if wrapping it? it's like making a…
Dimor
  • 53
  • 1
  • 7
0
votes
1 answer

Using compiler directive to warn if a file is missing

I have a file that is included on the bundle that has the following name: databaseX.sqlite where X is the app's version. If the version is 2.8, the file should be named database2.8.sqlite. I have to be sure to include this file when the app is…
Duck
  • 34,902
  • 47
  • 248
  • 470
0
votes
2 answers

Workaround for systemverilog there is no `if compiler directive

In systemverilog there is no `if compiler directive. So the following lines are incorrect: `define BITS 16 reg[`BITS-1:0] my_reg; ... `if `BITS > 10 my_reg[31] = 1'b0; endif ... Without `if there are warnings/errors. How can I workaround or…
betontalpfa
  • 3,454
  • 1
  • 33
  • 65
0
votes
1 answer

Interpretate directives for dynamic Html added from a $http response

Directive defined to add numeric input app.directive('numericCheck', function () { return { link: function (scope, element, attr) { element.on('keypress', function (event) { event = (event) ? event :…
Rochak
  • 28
  • 3
0
votes
1 answer

Why my compiler directive definition is not recognised? (Swift)

I have 3 targets. Let's say TargetA, TargetB, and TargetC. I have put in each target a different compiler directive in Targets > Target name > Build Settings > Apple LLVM 7.1 - Custom Compiler Flags > Other C Flags > Debug & Release. I put…
Chen Li Yong
  • 5,459
  • 8
  • 58
  • 124
1 2 3
8 9