>>403
素直に

Display *hoge() {
return XOpenDisplay(NULL);
}

main() {
 Display *display = hoge();
}

じゃ駄目なんか?