unlikely()

Hello ,

I want to convert linux code to windows code . But How can I convert
unlikely() function in windows .
I found __assume() but I dont know its true or not and also it gives error c2451.

I'm new in c++...
Where did you get your "linux code" from ? Because unlikely() macro is quite an advanced thing ...
http://stackoverflow.com/questions/109710/likely-unlikely-macros-in-the-linux-kernel
I'm workin ethernet programming Actually I'm new in C++ I used normally
C# But I have to use C++ native code...

But Only I found Linux sample so I want to convert Linux code To Visual Stdio...

I dont know How can I remove unlikely , anything I can use Windows macros instead of unlikely()

if (unlikely(configured_address == 0x0000))
EC_WARN("Using configured station address 0x0000!\n");javascript:editbox1.editSend()
unlikely(x) expands to __builtin_expect(x, 0)

You can safely remove it, it's just an optimisation.

You could just put
1
2
#define unlikely(x) (x)
#define likely(x) (x) 

and all the code would work the same.
Thank for your answer... I removed..
Topic archived. No new replies allowed.