Fix for PR46384. Failure on weak dllimport.