[GH-ISSUE #2091] get_power_of_two doesnt exist on MSVC #1400

Closed
opened 2026-10-14 03:47:54 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @crioux on GitHub (Mar 16, 2016).
Original GitHub issue: https://github.com/openwall/john/issues/2091

The default implementation of "get_power_of_two" doesn't exist in MSVC and things fail to compile. Also, the #define that is in common-opencl.h would suffice if it were moved to common.h so it could be used everywhere, except for the two cases where it is used strangely in src/opencl_rawsha512_ng_fmt_plug.c and src/opencl_rawsha256_fmt_plug.c:

elements = (get_power_of_two(elements)) + 1;

can be changed to

get_power_of_two(elements);
elements++;

and

        size = (get_power_of_two(memory_available));

can be replaced with

{
   size = memory_available;
   get_power_of_two(size);
}
Originally created by @crioux on GitHub (Mar 16, 2016). Original GitHub issue: https://github.com/openwall/john/issues/2091 The default implementation of "get_power_of_two" doesn't exist in MSVC and things fail to compile. Also, the #define that is in common-opencl.h would suffice if it were moved to common.h so it could be used everywhere, except for the two cases where it is used strangely in src/opencl_rawsha512_ng_fmt_plug.c and src/opencl_rawsha256_fmt_plug.c: ``` elements = (get_power_of_two(elements)) + 1; ``` can be changed to ``` get_power_of_two(elements); elements++; ``` and ``` size = (get_power_of_two(memory_available)); ``` can be replaced with ``` { size = memory_available; get_power_of_two(size); } ```
bsakaguchi 2026-10-14 03:47:54 +07:00
Author
Owner

@ghost commented on GitHub (Mar 16, 2016):

My fault, I'll fix the formats.

<!-- gh-comment-id:197436904 --> @ghost commented on GitHub (Mar 16, 2016): My fault, I'll fix the formats.
Author
Owner

@magnumripper commented on GitHub (Mar 17, 2016):

We don't really support building on MSVC as far as I know. I think @jfoug use to build "some" of Jumbo in MSVC for debugging.

<!-- gh-comment-id:198087241 --> @magnumripper commented on GitHub (Mar 17, 2016): We don't really support building on MSVC as far as I know. I think @jfoug use to build "some" of Jumbo in MSVC for debugging.
Author
Owner

@jfoug commented on GitHub (Mar 17, 2016):

I do not do opencl building/debugging in VC (thus my lack of doing too much development of those formats). So if someone else is doing VC builds of opencl, then they may be wanting certain things which fail compile. BUT since this is somewhat of a non-supported build, I think it is up to whoever is wanting this to find proper fixes and submit patches to get things working.

<!-- gh-comment-id:198091491 --> @jfoug commented on GitHub (Mar 17, 2016): I do not do opencl building/debugging in VC (thus my lack of doing too much development of those formats). So if someone else is doing VC builds of opencl, then they may be wanting certain things which fail compile. BUT since this is somewhat of a non-supported build, I think it is up to whoever is wanting this to find proper fixes and submit patches to get things working.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#1400
No description provided.