Questions tagged [p99]

P99 is a C99 macro library for C99.

P99 is a C99 macro library for C99 which provides a complete set a features such as easier struct initialization and default arguments for functions. It also emulates several features from C11.

6 questions
318
votes
7 answers

What is P99 latency?

What does P99 latency represent? I keep hearing about this in discussions about an application's performance but couldn't find a resource online that would talk about this.
maverik
  • 3,409
  • 3
  • 16
  • 7
6
votes
1 answer

P99 and C99 vs C11

Maybe I am misunderstanding the use of the P99 library but what advantages does it provide over C11 (mainly concerned about multithreading) if anything more than being an emulator. Speed? Efficiency? Or just backwards compat?
BAR
  • 15,909
  • 27
  • 97
  • 185
3
votes
1 answer

P99_FOR in C++11

I am using the P99_FOR macro defined in P99 in my C99 code in order to iterate over VA_ARGS. It works perfectly. P99_FOR(NAME, N, OP, FUNC,...) Now I want to migrate to C++11 and I was wondering if there is any macro similar to P99_FOR. Here is my…
ManiAm
  • 1,759
  • 5
  • 24
  • 43
3
votes
4 answers

How to tell if an optional argument was passed to a function C

Edit 3: For the code itself all together check the first answer or the end of this post. As stated in the title I'm trying to find a way to tell if an optional argument was passed to a function or not. What I'm trying to do is something like how…
133794m3r
  • 5,028
  • 3
  • 24
  • 37
1
vote
1 answer

How to test if a macro identifier is defined without using #ifdef?

Does anyone know how to, or if it's even possible to, create a variadic macro that expands to 0 if it's argument is not a defined macro, but expands to 1 if it's argument is a defined macro? (I'm using c99.) #define BOB #define SUE 45 #define…
textral
  • 1,029
  • 8
  • 13
0
votes
1 answer

C Macro to remove duplicates in list of arguments

I wonder if it is possible to build a gnu C macro which expands to a list of tokens (integer numbers) which are the arguments of the macro without duplicates. The number of arguments could be assumed fixed (for the moment). I.e. I want something…
highsciguy
  • 2,569
  • 3
  • 34
  • 59