diff options
Diffstat (limited to 'src/cz/crcs/ectester/standalone/libs/jni/c_utils.c')
| -rw-r--r-- | src/cz/crcs/ectester/standalone/libs/jni/c_utils.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/c_utils.c b/src/cz/crcs/ectester/standalone/libs/jni/c_utils.c index a5bc14d..46286fd 100644 --- a/src/cz/crcs/ectester/standalone/libs/jni/c_utils.c +++ b/src/cz/crcs/ectester/standalone/libs/jni/c_utils.c @@ -3,6 +3,10 @@ #include <string.h> #include <stdlib.h> +#if defined(__WIN32__) || defined(_MSC_VER) +#include <windows.h> +#endif + jclass ec_parameter_spec_class; jclass ecgen_parameter_spec_class; jclass secret_key_spec_class; @@ -228,7 +232,11 @@ char *biginteger_to_hex(JNIEnv *env, jobject big, jint bytes) { jstring big_string = (*env)->CallObjectMethod(env, big, to_string, (jint) 16); jsize len = (*env)->GetStringUTFLength(env, big_string); +#if defined(__WIN32__) || defined(_MSC_VER) + char *raw_string = _alloca(len); +#else char raw_string[len]; +#endif (*env)->GetStringUTFRegion(env, big_string, 0, len, raw_string); char *result = calloc(bytes, 2); |
