Skip to content

Commit

Permalink
Dont add regex lib on linux/mac and don't call creal on posix in Scal…
Browse files Browse the repository at this point in the history
…arMetaschemaType (not supported on mac for C++)
  • Loading branch information
langmm committed Jan 30, 2019
1 parent ace20f3 commit 7f774d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion cis_interface/drivers/GCCModelDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,11 +470,13 @@ def build_datatypes(just_obj=False, overwrite=False, as_shared=False):
overwrite=overwrite)
if just_obj:
return _datatypes_obj
obj_list = [_datatypes_obj]
# Compile regex for windows
if platform._is_win: # pragma: windows
_regex_obj = build_regex_win32(just_obj=True,
overwrite=overwrite)
call_link([_regex_obj, _datatypes_obj], dtype_lib, cpp=True, overwrite=overwrite)
obj_list.insert(0, _regex_obj)
call_link(obj_list, dtype_lib, cpp=True, overwrite=overwrite)


def build_regex_win32(just_obj=False, overwrite=False): # pragma: windows
Expand Down
9 changes: 6 additions & 3 deletions cis_interface/metaschema/datatypes/ScalarMetaschemaType.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,12 @@ class ScalarMetaschemaType : public MetaschemaType {
}
case T_COMPLEX: {
if (sizeof(float) == (bytes_precision / 2)) {
complex_double arg00 = va_arg(ap.va, complex_double);
complex_float arg0 = {(float)creal(arg00), (float)cimag(arg00)};
// complex_float arg0 = (complex_float)va_arg(ap.va, complex_double);
#ifdef _WIN32
complex_double arg00 = va_arg(ap.va, complex_double);
complex_float arg0 = {(float)creal(arg00), (float)cimag(arg00)};
#else
complex_float arg0 = (complex_float)va_arg(ap.va, complex_double);
#endif
memcpy(arg, &arg0, bytes_precision);
} else if (sizeof(double) == (bytes_precision / 2)) {
complex_double arg0 = va_arg(ap.va, complex_double);
Expand Down

0 comments on commit 7f774d8

Please sign in to comment.