diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2021-08-21 18:42:30 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2021-08-21 18:42:30 -0400 |
commit | 6a0b937064907c1790447f7ddd0c60e66e49cd70 (patch) | |
tree | 09cfd65ecb1b3f9816620f5b0091d5f512fa4239 /tools/nitrogfx/global.h | |
parent | 676ebab3d6ad726b3e154c994c4fcfdbb186ed22 (diff) |
nitrogfx compatibility with MSVCC
Diffstat (limited to 'tools/nitrogfx/global.h')
-rw-r--r-- | tools/nitrogfx/global.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/nitrogfx/global.h b/tools/nitrogfx/global.h index 65dd351d..32378a9f 100644 --- a/tools/nitrogfx/global.h +++ b/tools/nitrogfx/global.h @@ -28,4 +28,10 @@ do { \ #endif // _MSC_VER +#define PTR_ADD(ptr, value) ((void*)((uintptr_t)(ptr) + (value))) +#define PTR_SUB(ptr, value) ((void*)((uintptr_t)(ptr) - (value))) +#define PTR_IADD(ptr, value) do { (ptr) = PTR_ADD(ptr, value); } while (0) +#define PTR_ISUB(ptr, value) do { (ptr) = PTR_SUB(ptr, value); } while (0) +#define PTR_DIFF(right, left) ((uintptr_t)(right) - (uintptr_t)(left)) + #endif // GLOBAL_H |